-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
1,761 additions
and
130 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
Package org GENERATED BY gengo:enum | ||
Package org GENERATED BY gengo:enum | ||
DON'T EDIT THIS FILE | ||
*/ | ||
package org | ||
|
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
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ package otel | |
|
||
import ( | ||
"context" | ||
|
||
sdktrace "go.opentelemetry.io/otel/sdk/trace" | ||
) | ||
|
||
|
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
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,35 @@ | ||
package metrichttp | ||
|
||
import ( | ||
"github.com/innoai-tech/infra/pkg/otel/metric" | ||
"go.opentelemetry.io/otel/sdk/metric/aggregation" | ||
) | ||
|
||
var ( | ||
ClientDuration = metric.NewFloat64Histogram( | ||
"http.client.duration", | ||
metric.WithUnit("s"), | ||
metric.WithDescription("Measures the duration of outbound HTTP requests"), | ||
metric.WithAggregation(aggregation.ExplicitBucketHistogram{ | ||
Boundaries: DurationHistogramBoundaries, | ||
}), | ||
) | ||
|
||
ClientRequestSize = metric.NewInt64Histogram( | ||
"http.client.request.size", | ||
metric.WithUnit("By"), | ||
metric.WithDescription("Measures the size of HTTP response messages"), | ||
metric.WithAggregation(aggregation.ExplicitBucketHistogram{ | ||
Boundaries: SizeHistogramBoundaries, | ||
}), | ||
) | ||
|
||
ClientResponseSize = metric.NewInt64Histogram( | ||
"http.client.response.size", | ||
metric.WithUnit("By"), | ||
metric.WithDescription("Measures the size of HTTP response messages"), | ||
metric.WithAggregation(aggregation.ExplicitBucketHistogram{ | ||
Boundaries: SizeHistogramBoundaries, | ||
}), | ||
) | ||
) |
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,41 @@ | ||
package metrichttp | ||
|
||
import ( | ||
"github.com/innoai-tech/infra/pkg/otel/metric" | ||
"go.opentelemetry.io/otel/sdk/metric/aggregation" | ||
) | ||
|
||
var ( | ||
ServerDuration = metric.NewFloat64Histogram( | ||
"http.server.duration", | ||
metric.WithUnit("s"), | ||
metric.WithDescription("Measures the duration of inbound HTTP requests"), | ||
metric.WithAggregation(aggregation.ExplicitBucketHistogram{ | ||
Boundaries: DurationHistogramBoundaries, | ||
}), | ||
) | ||
|
||
ServerActiveRequest = metric.NewInt64UpDownCounter( | ||
"http.server.active_requests", | ||
metric.WithDescription("Measures the number of concurrent HTTP requests that are currently in-flight"), | ||
) | ||
|
||
ServerRequestSize = metric.NewInt64Histogram( | ||
"http.server.request.size", | ||
metric.WithUnit("By"), | ||
metric.WithDescription("Measures the size of HTTP response messages"), | ||
metric.WithAggregation(aggregation.ExplicitBucketHistogram{ | ||
Boundaries: SizeHistogramBoundaries, | ||
}), | ||
) | ||
|
||
ServerResponseSize = metric.NewInt64Histogram( | ||
"http.server.response.size", | ||
metric.WithUnit("By"), | ||
metric.WithDescription("Measures the size of HTTP response messages"), | ||
metric.WithAggregation(aggregation.ExplicitBucketHistogram{ | ||
Boundaries: SizeHistogramBoundaries, | ||
}), | ||
//metric.WithAggregationFunc("increase", 1*time.Minute), | ||
) | ||
) |
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,38 @@ | ||
package metrichttp | ||
|
||
var DurationHistogramBoundaries = []float64{ | ||
0, | ||
0.005, | ||
0.01, | ||
0.025, | ||
0.05, | ||
0.075, | ||
0.1, | ||
0.25, | ||
0.5, | ||
0.75, | ||
1, | ||
2.5, | ||
5, | ||
7.5, | ||
10, | ||
} | ||
|
||
const B = 1 | ||
const KiB = 1024 * B | ||
const MiB = 1024 * KiB | ||
|
||
var SizeHistogramBoundaries = []float64{ | ||
512 * B, | ||
1 * KiB, | ||
64 * KiB, | ||
128 * KiB, | ||
256 * KiB, | ||
512 * KiB, | ||
1 * MiB, | ||
2 * MiB, | ||
5 * MiB, | ||
10 * MiB, | ||
20 * MiB, | ||
50 * MiB, | ||
} |
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
Oops, something went wrong.