mirror of
https://github.com/hanzoai/otel-collector.git
synced 2026-10-30 18:26:25 +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
38 lines
880 B
Go
38 lines
880 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package common // import "github.com/hanzoai/otel-collector/processor/o11ytransformprocessor/internal/common"
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
type ContextID string
|
|
|
|
const (
|
|
Resource ContextID = "resource"
|
|
Scope ContextID = "scope"
|
|
Span ContextID = "span"
|
|
SpanEvent ContextID = "spanevent"
|
|
Metric ContextID = "metric"
|
|
DataPoint ContextID = "datapoint"
|
|
Log ContextID = "log"
|
|
)
|
|
|
|
func (c *ContextID) UnmarshalText(text []byte) error {
|
|
str := ContextID(strings.ToLower(string(text)))
|
|
switch str {
|
|
case Resource, Scope, Span, SpanEvent, Metric, DataPoint, Log:
|
|
*c = str
|
|
return nil
|
|
default:
|
|
return fmt.Errorf("unknown context %v", str)
|
|
}
|
|
}
|
|
|
|
type ContextStatements struct {
|
|
Context ContextID `mapstructure:"context"`
|
|
Statements []string `mapstructure:"statements"`
|
|
}
|