mirror of
https://github.com/hanzoai/otel-collector.git
synced 2026-11-03 02:20:04 +00:00
- Go module: github.com/SigNoz/signoz-otel-collector → github.com/hanzoai/otel-collector - All signoz-prefixed packages → o11y-prefixed - Docker: signoz/* → ghcr.io/hanzoai/otel-collector - ClickHouse exporter → Hanzo Datastore - Env vars: SIGNOZ_* → HANZO_* - Directory renames for all processor/receiver/exporter packages
21 lines
482 B
Go
21 lines
482 B
Go
package o11ykafkaexporter
|
|
|
|
import (
|
|
"go.opentelemetry.io/collector/client"
|
|
)
|
|
|
|
const (
|
|
DefaultKafkaTopicPrefix = "default"
|
|
)
|
|
|
|
// getKafkaTopicFromClientMetadata returns the kafka topic from client metadata
|
|
func getKafkaTopicPrefixFromClientMetadata(md client.Metadata) string {
|
|
// return default topic if no tenant id is found in client metadata
|
|
o11yTenantId := md.Get("o11y_tenant_id")
|
|
if len(o11yTenantId) != 0 {
|
|
return o11yTenantId[0]
|
|
}
|
|
|
|
return DefaultKafkaTopicPrefix
|
|
}
|