diff --git a/cmd/main.go b/cmd/main.go index 5ae0481..a08a7e0 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -22,7 +22,7 @@ import ( "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/prometheus-community/json_exporter/config" - "github.com/prometheus-community/json_exporter/internal" + "github.com/prometheus-community/json_exporter/exporter" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/common/promlog" @@ -83,12 +83,12 @@ func probeHandler(w http.ResponseWriter, r *http.Request, logger log.Logger, con registry := prometheus.NewPedanticRegistry() - metrics, err := internal.CreateMetricsList(config) + metrics, err := exporter.CreateMetricsList(config) if err != nil { level.Error(logger).Log("msg", "Failed to create metrics list from config", "err", err) //nolint:errcheck } - jsonMetricCollector := internal.JsonMetricCollector{JsonMetrics: metrics} + jsonMetricCollector := exporter.JsonMetricCollector{JsonMetrics: metrics} jsonMetricCollector.Logger = logger target := r.URL.Query().Get("target") @@ -97,7 +97,7 @@ func probeHandler(w http.ResponseWriter, r *http.Request, logger log.Logger, con return } - data, err := internal.FetchJson(ctx, logger, target, config) + data, err := exporter.FetchJson(ctx, logger, target, config) if err != nil { http.Error(w, "Failed to fetch JSON response. TARGET: "+target+", ERROR: "+err.Error(), http.StatusServiceUnavailable) return diff --git a/internal/collector.go b/exporter/collector.go similarity index 99% rename from internal/collector.go rename to exporter/collector.go index 110cebb..1ba489d 100644 --- a/internal/collector.go +++ b/exporter/collector.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package exporter import ( "errors" diff --git a/internal/util.go b/exporter/util.go similarity index 99% rename from internal/util.go rename to exporter/util.go index ff9c205..e2b3614 100644 --- a/internal/util.go +++ b/exporter/util.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package exporter import ( "context"