Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

2.6 KB
Raw Blame
package gatewaytypes

import (
	"time"
)

type IngestionKey struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Value       string    `json:"value"`
	ExpiresAt   time.Time `json:"expires_at"`
	Tags        []string  `json:"tags"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	WorkspaceID string    `json:"workspace_id"`
	Limits      []Limit   `json:"limits"`
}

type Limit struct {
	ID        string      `json:"id"`
	Signal    string      `json:"signal"` // "logs", "traces", "metrics"
	Config    LimitConfig `json:"config"`
	Tags      []string    `json:"tags"`
	CreatedAt time.Time   `json:"created_at"`
	UpdatedAt time.Time   `json:"updated_at"`
	KeyID     string      `json:"key_id"`
	Metric    LimitMetric `json:"metric"`
}

type LimitConfig struct {
	Day    *LimitValue `json:"day,omitempty"`
	Second *LimitValue `json:"second,omitempty"`
}

type LimitValue struct {
	Size  *int64 `json:"size,omitempty"`
	Count *int64 `json:"count,omitempty"`
}

type LimitMetric struct {
	Day    *LimitMetricValue `json:"day,omitempty"`
	Second *LimitMetricValue `json:"second,omitempty"`
}

type LimitMetricValue struct {
	Count int64 `json:"count"`
	Size  int64 `json:"size"`
}

type Pagination struct {
	Page    int `json:"page"`
	PerPage int `json:"per_page"`
	Pages   int `json:"pages"`
	Total   int `json:"total"`
}

type IngestionKeysParams struct {
	Page    int `query:"page"`
	PerPage int `query:"per_page"`
}

type SearchIngestionKeysParams struct {
	Name    string `query:"name" required:"true"`
	Page    int    `query:"page"`
	PerPage int    `query:"per_page"`
}

type GettableIngestionKeys struct {
	Keys       []IngestionKey `json:"keys"`
	Pagination Pagination     `json:"_pagination"`
}

type PostableIngestionKey struct {
	Name      string    `json:"name" required:"true"`
	Tags      []string  `json:"tags"`
	ExpiresAt time.Time `json:"expires_at"`
}

type GettableCreatedIngestionKey struct {
	ID    string `json:"id" required:"true"`
	Value string `json:"value" required:"true"`
}

type DeprecatedPostableIngestionKeyLimit struct {
	Signal string      `json:"signal"`
	Config LimitConfig `json:"config"`
	Tags   []string    `json:"tags"`
}

type GettableCreatedIngestionKeyLimit struct {
	ID string `json:"id" required:"true"`
}

type PostableIngestionKeyLimit struct {
	KeyID  string      `json:"keyId" required:"true"`
	Signal string      `json:"signal"`
	Config LimitConfig `json:"config"`
	Tags   []string    `json:"tags"`
}

type UpdatableIngestionKeyLimit struct {
	Config LimitConfig `json:"config" required:"true"`
	Tags   []string    `json:"tags"`
}