forked from gnolang/gno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(telemetry): move configuration to node config (gnolang#2021)
This PR moves Telemetry configuration to the centralised node config. h/t to @albttx for identifying this.
- Loading branch information
Showing
8 changed files
with
58 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Package config contains the configuration types and helpers for the telemetry | ||
// package. | ||
package config | ||
|
||
// Config is the configuration struct for the tm2 telemetry package. | ||
type Config struct { | ||
MetricsEnabled bool `toml:"enabled"` | ||
MeterName string `toml:"meter_name"` | ||
ServiceName string `toml:"service_name"` | ||
ExporterEndpoint string `toml:"exporter_endpoint" comment:"the endpoint to export metrics to, like a local OpenTelemetry collector"` | ||
} | ||
|
||
// DefaultTelemetryConfig is the default configuration used for the node. | ||
func DefaultTelemetryConfig() *Config { | ||
return &Config{ | ||
MetricsEnabled: false, | ||
MeterName: "gno.land", | ||
ServiceName: "gno.land", | ||
ExporterEndpoint: "", | ||
} | ||
} | ||
|
||
// TestTelemetryConfig is the test configuration. Currently it is an alias for | ||
// [DefaultTelemetryConfig]. | ||
func TestTelemetryConfig() *Config { | ||
return DefaultTelemetryConfig() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.