Skip to content

Commit

Permalink
mark handler_endpoint as unsupported for spanmetrics conversion
Browse files Browse the repository at this point in the history
Signed-off-by: erikbaranowski <[email protected]>
  • Loading branch information
erikbaranowski committed Apr 2, 2024
1 parent c878155 commit 50c7edd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ func (b *ConfigBuilder) translateSpanMetrics(otelCfg *otelcol.Config, cfg traces
removeExporter(otelCfg, "metrics", "prometheus")
delete(otelCfg.Service.Pipelines, metricsSpanmetricsID)

// If the spanmetrics configuration includes a handler_endpoint, we cannot convert it.
// This is intentionally after the section above which removes the custom spanmetrics processor
// so that the rest of the configuration can optionally be converted with the error.
if cfg.SpanMetrics.HandlerEndpoint != "" {
b.diags.Add(diag.SeverityLevelError, "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.")
return
}

// Add the spanmetrics connector to the otel config with the converted configuration
if otelCfg.Connectors == nil {
otelCfg.Connectors = map[otel_component.ID]otel_component.Config{}
Expand Down Expand Up @@ -134,7 +143,6 @@ func toSpanmetricsConnector(cfg *traces.SpanMetricsConfig) *spanmetricsconnector
// TODO: decide how to handle these fields
// cfg.SpanMetrics.ConstLabels
// cfg.SpanMetrics.MetricsInstance
// cfg.SpanMetrics.HandlerEndpoint

return smc
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(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) 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.
(Error) The converter does not support converting the provided grpc_tls_config server config: flow mode does not have a gRPC server to configure.
(Error) The converter does not support converting the provided prefer_server_cipher_suites server config.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ traces:
- endpoint: http://localhost:1234/write
automatic_logging:
backend: "something else"
spanmetrics:
handler_endpoint: http://localhost:1234/write

agent_management:
host: host_name

0 comments on commit 50c7edd

Please sign in to comment.