mirror of
https://github.com/prometheus-community/json_exporter
synced 2024-12-22 06:30:11 +00:00
Change package name from 'internal' to 'exporter'
Signed-off-by: rustyclock <rustyclock@protonmail.com>
This commit is contained in:
parent
9a50f9d6ec
commit
9f94906a18
@ -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
|
||||
|
@ -11,7 +11,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package internal
|
||||
package exporter
|
||||
|
||||
import (
|
||||
"errors"
|
@ -11,7 +11,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package internal
|
||||
package exporter
|
||||
|
||||
import (
|
||||
"context"
|
Loading…
Reference in New Issue
Block a user