add host info to userconfigurable overrides api#4854
Conversation
| 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.
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).
jcreixell
left a comment
There was a problem hiding this comment.
added a small comment but overall LGTM
There was a problem hiding this comment.
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.
(nit because I've tested and still works) but this test uses the defaults and it should be using non-defaults just in case
joe-elliott
left a comment
There was a problem hiding this comment.
one concern, but other than that i think this is ready to merge
modules/generator/config.go
Outdated
|
|
||
| copyCfg.ServiceGraphs.EnableVirtualNodeLabel = o.MetricsGeneratorProcessorServiceGraphsEnableVirtualNodeLabel(userID) | ||
|
|
||
| copyCfg.HostInfo.HostIdentifiers = o.MetricsGeneratorProcessorHostInfoHostIdentifiers(userID) |
There was a problem hiding this comment.
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.
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? |
joe-elliott
left a comment
There was a problem hiding this comment.
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
knylander-grafana
left a comment
There was a problem hiding this comment.
Thank you for updating the doc!
|
@joe-elliott are we good to merge? |
|
yup |
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.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]