Skip to content

Commit 9e17d1b

Browse files
committed
remove duplicate metrics file
Signed-off-by: sami <sami@appscode.com>
1 parent 703f90b commit 9e17d1b

File tree

3 files changed

+5
-36
lines changed

3 files changed

+5
-36
lines changed

cmd/pgoutbox/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"kubeops.dev/pgoutbox/internal/telemetry"
3131

3232
"github.com/urfave/cli/v2"
33+
"kubeops.dev/pgoutbox/internal/telemetry/metrics"
3334
"kubeops.dev/pgoutbox/internal/util"
3435
)
3536

@@ -110,7 +111,7 @@ func main() {
110111
}
111112
}()
112113

113-
metrics, err := apis.NewMetrics()
114+
metrics, err := metrics.New()
114115
if err != nil {
115116
return fmt.Errorf("initialize metrics: %w", err)
116117
}
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,4 @@
1-
/*
2-
Copyright AppsCode Inc. and Contributors
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
16-
17-
package apis
1+
package metrics
182

193
import (
204
"context"
@@ -46,7 +30,7 @@ type Metrics struct {
4630
currentLSN metric.Int64Gauge
4731
}
4832

49-
func NewMetrics() (*Metrics, error) {
33+
func New() (*Metrics, error) {
5034
meter := otel.Meter(meterName)
5135

5236
eventsPublished, err := meter.Int64Counter(
Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
Copyright AppsCode Inc. and Contributors
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
16-
171
package telemetry
182

193
import (
@@ -24,7 +8,7 @@ import (
248
"go.opentelemetry.io/otel/exporters/prometheus"
259
"go.opentelemetry.io/otel/sdk/metric"
2610
"go.opentelemetry.io/otel/sdk/resource"
27-
semconv "go.opentelemetry.io/otel/semconv/v1.26.0"
11+
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
2812
)
2913

3014
var meterProvider *metric.MeterProvider

0 commit comments

Comments
 (0)