Skip to content

Commit

Permalink
Added support for static configuration conversion of the traces subsy…
Browse files Browse the repository at this point in the history
…stem (#6820)

Signed-off-by: erikbaranowski <[email protected]>
  • Loading branch information
erikbaranowski authored Apr 3, 2024
1 parent ccff374 commit 6882011
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Main (unreleased)

- Added support for `otelcol` configuration conversion in `grafana-agent convert` and `grafana-agent run` commands. (@rfratto, @erikbaranowski, @tpaschalis, @hainenber)

- Added support for `static` configuration conversion of the `traces` subsystem. (@erikbaranowski, @wildum)

- Add automatic conversion for `legacy_positions_file` in component `loki.source.file`. (@mattdurham)

### Features
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/flow/tasks/migrate/from-static.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ After the configuration is converted, review the {{< param "PRODUCT_NAME" >}} co

The following list is specific to the convert command and not {{< param "PRODUCT_NAME" >}}:

* The [Traces][] and [Agent Management][] configuration options can't be automatically converted to {{< param "PRODUCT_NAME" >}}. However, traces are fully supported in {{< param "PRODUCT_NAME" >}} and you can build your configuration manually.
* The [Agent Management][] configuration options can't be automatically converted to {{< param "PRODUCT_NAME" >}}.
Any additional unsupported features are returned as errors during conversion.
* There is no gRPC server to configure for {{< param "PRODUCT_NAME" >}}, as any non-default configuration will show as unsupported during the conversion.
* Check if you are using any extra command line arguments with Static that aren't present in your configuration file. For example, `-server.http.address`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ func (b *ConfigBuilder) appendTraces() {
// Remove the push receiver which is an implementation detail for static mode and unnecessary for the otel config.
removeReceiver(otelCfg, "traces", "push_receiver")

// Remove the service_graphs processor which is an implementation detail for static mode and unnecessary for the otel config.
if _, ok := otelCfg.Processors[otel_component.NewID("service_graphs")]; ok {
removeProcessor(otelCfg, "traces", "service_graphs")
b.diags.Add(diag.SeverityLevelError, "The service_graphs processor for traces has no direct flow equivalent. "+
"This configuration appends metrics to the /metrics endpoint of the agent which is not possible in flow. "+
"Alternatively, you can use the otelcol.connector.servicegraph component to build a pipeline which generates "+
"and forwards service graph metrics.")
}

b.translateAutomaticLogging(otelCfg, cfg)
b.translateSpanMetrics(otelCfg, cfg)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ traces:
hostnames:
- tempo1.example.com
- tempo2.example.com
# service_graphs:
# enabled: true
jaeger_remote_sampling:
- source:
reload_interval: 30s
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(Error) The converter does not support handling integrations which are not being scraped: mssql.
(Error) mapping_config is not supported in statsd_exporter integrations config
(Error) The service_graphs processor for traces has no direct flow equivalent. This configuration appends metrics to the /metrics endpoint of the agent which is not possible in flow. Alternatively, you can use the otelcol.connector.servicegraph component to build a pipeline which generates and forwards service graph metrics.
(Error) automatic_logging for traces has no direct flow equivalent. A best effort translation can be made which only outputs to stdout and not directly to loki by bypassing errors.
(Error) Cannot convert using configuration including spanmetrics handler_endpoint. No equivalent exists for exposing a known /metrics endpoint. You can use metrics_instance instead to enabled conversion.
(Warning) Please review your agent command line flags and ensure they are set in your Flow mode config file where necessary.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ traces:
backend: "something else"
spanmetrics:
handler_endpoint: http://localhost:1234/write
service_graphs:
enabled: true

agent_management:
host: host_name

0 comments on commit 6882011

Please sign in to comment.