Skip to content

Commit

Permalink
[CHORE] applying pr comments
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Takashi <[email protected]>
  • Loading branch information
nicolastakashi committed Jan 6, 2025
1 parent 493fe90 commit 48a7136
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cmd/thanos/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func runReceive(

AsyncForwardWorkerCount: conf.asyncForwardWorkerCount,
ReplicationProtocol: receive.ReplicationProtocol(conf.replicationProtocol),
OtlpDisableTargetInfo: conf.otlpDisableTargetInfo,
OtlpEnableTargetInfo: conf.otlpEnableTargetInfo,
OtlpResourceAttributes: conf.otlpResourceAttributes,
})

Expand Down Expand Up @@ -899,7 +899,7 @@ type receiveConfig struct {

headExpandedPostingsCacheSize uint64
compactedBlocksExpandedPostingsCacheSize uint64
otlpDisableTargetInfo bool
otlpEnableTargetInfo bool
otlpResourceAttributes []string
}

Expand Down Expand Up @@ -1056,8 +1056,8 @@ func (rc *receiveConfig) registerFlag(cmd extkingpin.FlagClause) {
cmd.Flag("receive.limits-config-reload-timer", "Minimum amount of time to pass for the limit configuration to be reloaded. Helps to avoid excessive reloads.").
Default("1s").Hidden().DurationVar(&rc.limitsConfigReloadTimer)

cmd.Flag("receive.otlp-disable-target-info", "Disable target information OTLP metrics ingested by Receive.").Default("false").BoolVar(&rc.otlpDisableTargetInfo)
cmd.Flag("receive.otlp-resource-attributes", "(Repeatable) Resource attributes to include in OTLP metrics ingested by Receive.").Default("").StringsVar(&rc.otlpResourceAttributes)
cmd.Flag("receive.otlp-enable-target-info", "Disable target information OTLP metrics ingested by Receive. If enabled, converts the resource to the target info metric").Default("fakse").BoolVar(&rc.otlpEnableTargetInfo)
cmd.Flag("receive.otlp-promote-resource-attributes", "(Repeatable) Resource attributes to include in OTLP metrics ingested by Receive.").Default("").StringsVar(&rc.otlpResourceAttributes)

rc.featureList = cmd.Flag("enable-feature", "Comma separated experimental feature names to enable. The current list of features is "+metricNamesFilter+".").Default("").Strings()
}
Expand Down
7 changes: 4 additions & 3 deletions docs/components/receive.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,11 @@ Flags:
configuration. If it's empty AND hashring
configuration was provided, it means that
receive will run in RoutingOnly mode.
--receive.otlp-disable-target-info
--receive.otlp-enable-target-info
Disable target information OTLP metrics
ingested by Receive.
--receive.otlp-resource-attributes= ...
ingested by Receive. If enabled, converts the
resource to the target info metric
--receive.otlp-promote-resource-attributes= ...
(Repeatable) Resource attributes to include in
OTLP metrics ingested by Receive.
--receive.relabel-config=<content>
Expand Down
2 changes: 1 addition & 1 deletion pkg/receive/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ type Options struct {
Limiter *Limiter
AsyncForwardWorkerCount uint
ReplicationProtocol ReplicationProtocol
OtlpDisableTargetInfo bool
OtlpEnableTargetInfo bool
OtlpResourceAttributes []string
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/receive/handler_otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (h *Handler) convertToPrometheusFormat(ctx context.Context, pmetrics pmetri
converter := otlptranslator.NewPrometheusConverter()
settings := otlptranslator.Settings{
AddMetricSuffixes: true,
DisableTargetInfo: h.options.OtlpDisableTargetInfo,
DisableTargetInfo: h.options.OtlpEnableTargetInfo,
PromoteResourceAttributes: h.options.OtlpResourceAttributes,
}

Expand Down

0 comments on commit 48a7136

Please sign in to comment.