Add CloudWatch metrics

This commit is contained in:
DarthSim
2022-12-04 21:01:37 +06:00
parent bf472d3df9
commit 79e473798d
4 changed files with 278 additions and 1 deletions

View File

@@ -156,6 +156,10 @@ var (
OpenTelemetryTraceIDGenerator string
OpenTelemetryConnectionTimeout int
CloudWatchServiceName string
CloudWatchNamespace string
CloudWatchRegion string
BugsnagKey string
BugsnagStage string
@@ -334,6 +338,10 @@ func Reset() {
OpenTelemetryTraceIDGenerator = "xray"
OpenTelemetryConnectionTimeout = 5
CloudWatchServiceName = ""
CloudWatchNamespace = "imgproxy"
CloudWatchRegion = ""
BugsnagKey = ""
BugsnagStage = "production"
@@ -527,6 +535,10 @@ func Configure() error {
configurators.String(&OpenTelemetryTraceIDGenerator, "IMGPROXY_OPEN_TELEMETRY_TRACE_ID_GENERATOR")
configurators.Int(&OpenTelemetryConnectionTimeout, "IMGPROXY_OPEN_TELEMETRY_CONNECTION_TIMEOUT")
configurators.String(&CloudWatchServiceName, "IMGPROXY_CLOUD_WATCH_SERVICE_NAME")
configurators.String(&CloudWatchNamespace, "IMGPROXY_CLOUD_WATCH_NAMESPACE")
configurators.String(&CloudWatchRegion, "IMGPROXY_CLOUD_WATCH_REGION")
configurators.String(&BugsnagKey, "IMGPROXY_BUGSNAG_KEY")
configurators.String(&BugsnagStage, "IMGPROXY_BUGSNAG_STAGE")
configurators.String(&HoneybadgerKey, "IMGPROXY_HONEYBADGER_KEY")