-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/apache]: add optional apache.server.name resource attribute #14926
[receiver/apache]: add optional apache.server.name resource attribute #14926
Conversation
5d98e89
to
49752c4
Compare
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.
@dmitryax as a breaking change for a "beta" receiver, should this be behind a feature gate? i recall that was the decision for the hostmetrics receiver.
I believe many backends flatten the attribute so it could've be ok to merge but the attribute name is changed which is a breaking change anyway. So I agree that it should be done through a feature gate. @aboguszewski-sumo can you please update break the change into several steps using a feature gate:
this should span over several releases cc @djaglowski as code owner |
@dmitryax sure, I can do this. However, I'm not sure if I understand how it should be done, so please correct me if I'm wrong:
To sum up: Also - I want to add a |
49752c4
to
a376537
Compare
I have force pushed the changes for the first step on this branch (I have a backup of the original if needed). Please review if it's what you meant. |
Removing
About mdatagen:
|
134e6f9
to
c615a18
Compare
c615a18
to
6bac04c
Compare
Sorry for the misunderstanding, I have pushed a version with feature gate. |
Yes, that's an ideal approach |
receiver/apachereceiver/config.go
Outdated
@@ -28,6 +28,7 @@ type Config struct { | |||
scraperhelper.ScraperControllerSettings `mapstructure:",squash"` | |||
confighttp.HTTPClientSettings `mapstructure:",squash"` | |||
serverName string | |||
emitServerNameAsResourceAttribute bool |
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 is still a config option, not a feature gate. Please take a look at this feature gates example
emitMetricsWithDirectionAttributeFeatureGate = featuregate.Gate{ |
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.
There is a feature gate used, just not directly in the scraper, but in the factory:
https://github.com/aboguszewski-sumo/opentelemetry-collector-contrib/blob/6bac04c5014dbda6dfe8a424c02b9ab93459cbcc/receiver/apachereceiver/factory.go#L38-L50
I just thought that a pattern where it is injected in the scraper with the config seems more reasonable. I'll just move this code to the scraper then.
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.
Changed.
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.
@dmitryax, I agree w/ your suggestions here.
Since there is some ongoing work, I invalidated your previous approval to make sure this doesn't get merged prematurely.
40161d6
to
825ebe4
Compare
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.
LGTM. Just few nits
receiver/apachereceiver/internal/metadata/deprecated_metrics.go
Outdated
Show resolved
Hide resolved
receiver/apachereceiver/scraper.go
Outdated
} | ||
|
||
if !a.emitMetricsWithServerNameAsResourceAttribute { | ||
settings.Logger.Warn(fmt.Sprintf("Feature gate %s is not enabled. Please see the README.md file of apache receiver for more information.", EmitServerNameAsResourceAttribute)) |
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.
Maybe just put a link to README here?
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 added the link. However, I was not sure which branch/tag should we link to - I picked main
, to avoid predicting if the next stable version will be v0.63.0
or some other v0.63.x
like in case of v0.57
.
8c12baf
to
3ac9b82
Compare
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.
LGTM
This did not manage to be merged before @dmitryax any chance of merging this soon? |
@djaglowski @dmitryax what's the status of this PR? I believe I've made all necessary changes. |
…open-telemetry#14926) * feat: add feature gate with default path
…open-telemetry#14926) * feat: add feature gate with default path
Description:
Server name is used as a normal attribute, but it should be a resource attribute. This PR does the first step of changing it, by adding a feature gate to use
apache.server.name
resource attribute instead ofserver_name
metric-level attribute.Link to tracking Issue: #14791
Testing:
Unit and integration tests.
Documentation:
mdatagen
and changes toREADME.md