Skip to content

Commit

Permalink
Add service.instance.id to chronosphere metrics (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
edeNFed committed Feb 23, 2024
1 parent 6a801e2 commit df3328a
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion autoscaler/controllers/gateway/config/chronosphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,32 @@ func (c *Chronosphere) ModifyConfig(dest *odigosv1.Destination, currentConfig *c
}

if isMetricsEnabled(dest) {
// Set service.instance.id to pod name or node name
chronosphereMetricProcessorName := "resource/chornosphere-" + dest.Name
currentConfig.Processors[chronosphereMetricProcessorName] = commonconf.GenericMap{
"attributes": []commonconf.GenericMap{
{
"key": "service.instance.id",
"from_attribute": "k8s.node.name",
"action": "insert",
},
{
"key": "service.instance.id",
"from_attribute": "k8s.pod.name",
"action": "upsert",
},
{
"key": "instrumentation.control.plane",
"value": "odigos",
"action": "insert",
},
},
}

metricsPipelineName := "metrics/chronosphere-" + dest.Name
currentConfig.Service.Pipelines[metricsPipelineName] = commonconf.Pipeline{
Exporters: []string{chronosphereExporterName},
Exporters: []string{chronosphereExporterName},
Processors: []string{chronosphereMetricProcessorName},
}
}
}
Expand Down

0 comments on commit df3328a

Please sign in to comment.