Documentation ¶
Index ¶
Constants ¶
View Source
const ( WgFederatedGraphId = attribute.Key("wg.federated_graph.id") WgOrganizationId = attribute.Key("wg.organization.id") )
View Source
const (
DefaultServerName = "cosmo-graphqlmetrics"
)
View Source
const (
RequestCount = "http.requests.total"
)
Variables ¶
This section is empty.
Functions ¶
func NewPrometheusServer ¶
Types ¶
type Config ¶
type Config struct { // Name represents the service name for metrics. The default value is cosmo-router. Name string // Version represents the service version for metrics. The default value is dev. Version string // Prometheus includes the Prometheus configuration Prometheus PrometheusConfig // CustomMetrics to be collected CustomMetrics CustomMetrics // MetricStore the store to collect the metrics in MetricStore Provider }
Config represents the telemetry configuration.
func NewTelemetryConfig ¶
func NewTelemetryConfig(serviceVersion string, prometheusConfig PrometheusConfig) *Config
NewTelemetryConfig creates the config to be used for the telemetry inside graphqlmetrics.
func (*Config) NewPrometheusMeterProvider ¶
func (c *Config) NewPrometheusMeterProvider(ctx context.Context) (*sdkmetric.MeterProvider, *prometheus.Registry, error)
func (*Config) ObservabilityInterceptor ¶
func (c *Config) ObservabilityInterceptor() connect.UnaryInterceptorFunc
type CustomMetrics ¶
type CustomMetrics struct {
// contains filtered or unexported fields
}
type PromMetricStore ¶
type PromMetricStore struct {
// contains filtered or unexported fields
}
func (*PromMetricStore) MeasureRequestCount ¶
func (h *PromMetricStore) MeasureRequestCount(ctx context.Context, attr ...attribute.KeyValue)
type PrometheusConfig ¶
type PrometheusConfig struct { Enabled bool ListenAddr string Path string TestRegistry *prometheus.Registry }
Click to show internal directories.
Click to hide internal directories.