Files
zeekay 087e487107 feat: rebrand signoz-otel-collector → Hanzo OTEL Collector
- 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
2026-03-12 00:21:24 -07:00

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"`
}