mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-29 07:58:14 +02:00
move packages
This commit is contained in:
parent
fda1dfbd90
commit
92bbab70ac
17 changed files with 15 additions and 15 deletions
|
@ -13,7 +13,7 @@ import (
|
|||
connect_mux "github.com/pomerium/pomerium/internal/zero/connect-mux"
|
||||
"github.com/pomerium/pomerium/internal/zero/grpcconn"
|
||||
"github.com/pomerium/pomerium/internal/zero/healthcheck"
|
||||
metrics_reporter "github.com/pomerium/pomerium/internal/zero/reporter"
|
||||
metrics_reporter "github.com/pomerium/pomerium/internal/zero/telemetry/reporter"
|
||||
token_api "github.com/pomerium/pomerium/internal/zero/token"
|
||||
"github.com/pomerium/pomerium/pkg/fanout"
|
||||
cluster_api "github.com/pomerium/pomerium/pkg/zero/cluster"
|
||||
|
|
|
@ -12,13 +12,13 @@ import (
|
|||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/log"
|
||||
"github.com/pomerium/pomerium/internal/zero/analytics"
|
||||
sdk "github.com/pomerium/pomerium/internal/zero/api"
|
||||
"github.com/pomerium/pomerium/internal/zero/bootstrap"
|
||||
"github.com/pomerium/pomerium/internal/zero/healthcheck"
|
||||
"github.com/pomerium/pomerium/internal/zero/leaser"
|
||||
"github.com/pomerium/pomerium/internal/zero/reconciler"
|
||||
"github.com/pomerium/pomerium/internal/zero/reporter"
|
||||
"github.com/pomerium/pomerium/internal/zero/telemetry/analytics"
|
||||
"github.com/pomerium/pomerium/internal/zero/telemetry/reporter"
|
||||
"github.com/pomerium/pomerium/pkg/cmd/pomerium"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
)
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/zero/analytics"
|
||||
"github.com/pomerium/pomerium/internal/zero/telemetry/analytics"
|
||||
)
|
||||
|
||||
func TestActiveUsers(t *testing.T) {
|
|
@ -6,7 +6,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/zero/analytics"
|
||||
"github.com/pomerium/pomerium/internal/zero/telemetry/analytics"
|
||||
)
|
||||
|
||||
func TestStorage(t *testing.T) {
|
|
@ -1,4 +1,4 @@
|
|||
package convert
|
||||
package prometheus
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
@ -19,10 +19,10 @@ type FilterFn func(metricname string) (string, bool)
|
|||
// returns the new attribute name and true if the attribute should be included
|
||||
type RelabelFn func(metricname string) (string, bool)
|
||||
|
||||
// PrometheusToOTLP converts a prometheus metric stream to OTLP metrics
|
||||
// ToOTLP converts a prometheus metric stream to OTLP metrics
|
||||
// the filter function is used to filter out unwanted metrics
|
||||
// the relabel function is used to relabel metric attributes
|
||||
func PrometheusToOTLP(
|
||||
func ToOTLP(
|
||||
src io.Reader,
|
||||
filter FilterFn,
|
||||
relabel RelabelFn,
|
|
@ -1,4 +1,4 @@
|
|||
package convert_test
|
||||
package prometheus_test
|
||||
|
||||
import (
|
||||
"embed"
|
||||
|
@ -14,7 +14,7 @@ import (
|
|||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/sdk/metric/metricdata"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/zero/reporter/convert"
|
||||
"github.com/pomerium/pomerium/internal/zero/telemetry/prometheus"
|
||||
)
|
||||
|
||||
//go:embed testdata
|
||||
|
@ -105,7 +105,7 @@ func TestConvert(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
defer fd.Close()
|
||||
|
||||
got, err := convert.PrometheusToOTLP(fd,
|
||||
got, err := prometheus.ToOTLP(fd,
|
||||
func(name string) (string, bool) {
|
||||
return name, true
|
||||
}, func(label string) (string, bool) {
|
|
@ -1,4 +1,4 @@
|
|||
package convert
|
||||
package prometheus
|
||||
|
||||
import (
|
||||
"bufio"
|
|
@ -1,4 +1,4 @@
|
|||
package convert_test
|
||||
package prometheus_test
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
@ -13,7 +13,7 @@ import (
|
|||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/testing/protocmp"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/zero/reporter/convert"
|
||||
"github.com/pomerium/pomerium/internal/zero/telemetry/prometheus"
|
||||
)
|
||||
|
||||
func TestMetricFamilyStream(t *testing.T) {
|
||||
|
@ -89,7 +89,7 @@ cpu_seconds_total 12345.6
|
|||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
reader := strings.NewReader(tt.input)
|
||||
metricStream := convert.NewMetricFamilyStream(reader)
|
||||
metricStream := prometheus.NewMetricFamilyStream(reader)
|
||||
|
||||
var got []*dto.MetricFamily
|
||||
for {
|
Loading…
Add table
Add a link
Reference in a new issue