-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename indexer metrics related to get operations #853
Conversation
Rename indexer get metrics (histogram) to be specific to each type of indexer. Currently, file system, zip and storage indexers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
}, | ||
) | ||
|
||
StorageIndexerGetDurationSeconds = prometheus.NewHistogram( | ||
IndexerGetDurationSeconds = prometheus.NewHistogramVec( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm, I am wondering how useful is this metric. Looking at the sample metrics in the description, they seem to be all quite fast as these operations happen mostly in memory, and they end up all in the lower bucket.
We also have metrics in the middleware for /search
, that may be more useful for final users, as it includes the time of the whole response.
So I wonder if maybe we can remove this metric. Or if we leave it, lower the boundaries of each bucket so they don't end up all in the lower bucket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I don't have data about these get operations in the storage indexer.
I was expecting that this metric would be more significant in that storage indexer than in the file system indexers. I was thinking that maybe those get ops against storage indexer would be slower (just hypothesis, I don't have data about this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, current implementations are only filtering a list in memory. But it is true that the operation in the storage indexer is in a mutex whose lock can have some wait time while the index is updated. We may revisit the bucket thresholds when we have more data.
@@ -68,7 +68,7 @@ var ( | |||
func init() { | |||
flag.BoolVar(&printVersionInfo, "version", false, "Print Elastic Package Registry version") | |||
flag.StringVar(&address, "address", "localhost:8080", "Address of the package-registry service.") | |||
flag.StringVar(&metricsAddress, "metrics-address", "", "Address to expose the Prometheus metrics.") | |||
flag.StringVar(&metricsAddress, "metrics-address", "", "Address to expose the Prometheus metrics (experimental). ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor change here to add this Prometheus metric endpoint is subject to changes.
Do you think it is worthy to add it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, we may redefine something else while we start using it.
CHANGELOG.md
Outdated
* Rename indexer metrics related to get operations. [#853](https://github.com/elastic/package-registry/pull/853) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be moved to another section in the changelog ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can fit as a bugfix 🙂 Though it could be also seen as a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bugfix is fine :)
CHANGELOG.md
Outdated
* Rename indexer metrics related to get operations. [#853](https://github.com/elastic/package-registry/pull/853) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bugfix is fine :)
storage/indexer.go
Outdated
@@ -43,6 +46,7 @@ func NewIndexer(storageClient *storage.Client, options IndexerOptions) *Indexer | |||
return &Indexer{ | |||
storageClient: storageClient, | |||
options: options, | |||
label: "StorageIndexer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm.. could it be a const instead of a structure field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to follow the same structure that it is used for FileSystemIndexers (link) where the label is part of the struct. But it is true that for storage indexer it is not needed to add that label as a field struct. So, I'll move it to be a const.
}, | ||
) | ||
|
||
StorageIndexerGetDurationSeconds = prometheus.NewHistogram( | ||
IndexerGetDurationSeconds = prometheus.NewHistogramVec( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, current implementations are only filtering a list in memory. But it is true that the operation in the storage indexer is in a mutex whose lock can have some wait time while the index is updated. We may revisit the bucket thresholds when we have more data.
@@ -48,7 +44,7 @@ func (c CombinedIndexer) Get(ctx context.Context, opts *packages.GetOptions) (pa | |||
packages = packages.Join(p) | |||
} | |||
|
|||
if !opts.Filter.AllVersions { | |||
if opts != nil && opts.Filter != nil && !opts.Filter.AllVersions { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was needed after updating this branch with main.
This Get method is called with opts as nil
from https://github.com/elastic/package-registry/blob/main/main.go#L290
…s (get operations) (#3863) Update field mappings, ingest pipeline and dashboard accordingly with the changes done in elastic/package-registry#853 Specially, get operations related to indexers are now reporting the values per each indexer (using labels).
Rename indexer get metrics (histogram) to be specific to each type of indexer.
According to the current indexers, this refers to be able to split Get operations depending on the file system, zip and storage indexers.
Calculations of these metrics have been moved to their specific implementations (Get method).
Relates #797
Before this PR, the metrics exposed for Get operations were:
With this patch proposed, the metrics exposed will be like this: