mirror of
https://github.com/hanzoai/o11y.git
synced 2026-10-15 12:58:33 +00:00
Full rebrand of the SigNoz observability platform: - Go module: github.com/SigNoz/signoz → github.com/hanzoai/o11y - Frontend: @signozhq/* → @hanzo/o11y-*, posthog-js → @hanzo/insights - Docker: signoz/* → ghcr.io/hanzoai/o11y* - ClickHouse → Hanzo Datastore (hanzoai/datastore) - Env vars: SIGNOZ_* → HANZO_* - DB tables: signoz_* → o11y_* - All branding, URLs, docs updated - 2172 files changed
34 lines
874 B
Go
34 lines
874 B
Go
package integrations
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/hanzoai/o11y/pkg/query-service/constants"
|
|
"github.com/hanzoai/o11y/pkg/types/pipelinetypes"
|
|
)
|
|
|
|
const IntegrationPipelineIdSeparator string = "--"
|
|
|
|
func AliasForIntegrationPipeline(
|
|
integrationId string, pipelineName string,
|
|
) string {
|
|
return strings.Join(
|
|
[]string{constants.IntegrationPipelineIdPrefix, integrationId, pipelineName},
|
|
IntegrationPipelineIdSeparator,
|
|
)
|
|
}
|
|
|
|
// Returns ptr to integration_id string if `p` is a pipeline for an installed integration.
|
|
// Returns null otherwise.
|
|
func IntegrationIdForPipeline(p pipelinetypes.GettablePipeline) *string {
|
|
if strings.HasPrefix(p.Alias, constants.IntegrationPipelineIdPrefix) {
|
|
parts := strings.Split(p.Alias, IntegrationPipelineIdSeparator)
|
|
if len(parts) < 2 {
|
|
return nil
|
|
}
|
|
integrationId := parts[1]
|
|
return &integrationId
|
|
}
|
|
return nil
|
|
}
|