-
Notifications
You must be signed in to change notification settings - Fork 557
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
add host info to userconfigurable overrides api #4854
base: main
Are you sure you want to change the base?
Conversation
@@ -62,7 +62,7 @@ func Test_UserConfigOverridesAPI_overridesHandlers(t *testing.T) { | |||
name: "GET", | |||
handler: overridesAPI.GetHandler, | |||
req: prepareRequest(tenant, "GET", nil), | |||
expResp: `{"forwarders":["my-other-forwarder"],"cost_attribution":{},"metrics_generator":{"processor":{"service_graphs":{},"span_metrics":{}}}}`, |
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.
we can add a test here, set some pre-defined values in overridesAPI
and extend the postJSON payload to include different values. I was particularly interested on whether setting an empty list of host identifiers and an empty metric name would override previous values. Seems like it does but having test coverage would be nice. (I was interested in that particular case because it would allow us to disable host info metric generation on a tenant to tenant basis without needing an extra boolean).
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.
added a small comment but overall LGTM
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.
do we need to add code here so that the host info processor reloads correctly?
https://github.com/grafana/tempo/blob/main/modules/generator/instance.go#L277
here as well?
https://github.com/grafana/tempo/blob/main/modules/generator/config.go#L157
5ef2397
to
ca57d2d
Compare
modules/generator/instance_test.go
Outdated
hostinfo.Name: {}, | ||
} | ||
overrides.hostInfoHostIdentifiers = []string{"host.id"} | ||
overrides.hostInfoMetricName = "traces_host_info" |
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.
(nit because I've tested and still works) but this test uses the defaults and it should be using non-defaults just in case
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.
one concern, but other than that i think this is ready to merge
modules/generator/config.go
Outdated
@@ -223,6 +223,10 @@ func (cfg *ProcessorConfig) copyWithOverrides(o metricsGeneratorOverrides, userI | |||
|
|||
copyCfg.ServiceGraphs.EnableVirtualNodeLabel = o.MetricsGeneratorProcessorServiceGraphsEnableVirtualNodeLabel(userID) | |||
|
|||
copyCfg.HostInfo.HostIdentifiers = o.MetricsGeneratorProcessorHostInfoHostIdentifiers(userID) |
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 know you've just copied this from the above lines, but this is a bug b/c it always overrides the config provided to tempo with the user overrides. there is an issue about this somewhere but i can't find it.
can we conditionally overwrite the config only if there is an actual provided value from the overrides? preferably by returning a nil pointer to mean: "there is no value".
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 Joe. I added the checks here similar to other overrides I saw in this method. Let me know if this is what you had in mind
ca57d2d
to
06ecf4e
Compare
Should we add host info to the doc for the user-configurable overrides? |
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! Thanks Robbie.
Will wait on @knylander-grafana 's doc request before merging.
updated the docs -- my editor automatically removed the |
docs/sources/tempo/operations/manage-advanced-systems/user-configurable-overrides.md
Outdated
Show resolved
Hide resolved
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.
Thank you for updating the doc!
What this PR does:
This PR adds support for the host info processor to the user configurable overrides api.
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]