Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Change /metrics into the community edition #216

Merged
merged 2 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions internal/server/metrics/metrics.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright 2021 Gitploy.IO Inc. All rights reserved.
// Use of this source code is governed by the Gitploy Non-Commercial License
// that can be found in the LICENSE file.

// +build !oss

package metrics

import (
Expand All @@ -19,15 +25,6 @@ const (
)

type (
Metric struct {
prometheusAuthSecret string
}

MetricConfig struct {
Interactor
PrometheusAuthSecret string
}

collector struct {
i Interactor

Expand Down
17 changes: 17 additions & 0 deletions internal/server/metrics/metrics_oss.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// +build oss

package metrics

import (
"net/http"

"github.com/gin-gonic/gin"
)

func NewMetric(c *MetricConfig) *Metric {
return &Metric{}
}

func (m *Metric) CollectMetrics(c *gin.Context) {
c.Status(http.StatusOK)
}
12 changes: 12 additions & 0 deletions internal/server/metrics/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package metrics

type (
Metric struct {
prometheusAuthSecret string
}

MetricConfig struct {
Interactor
PrometheusAuthSecret string
}
)