Skip to content

Add Docker #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2020
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
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ARG ARCH="amd64"
ARG OS="linux"
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:glibc
LABEL maintainer="The Prometheus Authors <prometheus-developers@googlegroups.com>"

ARG ARCH="amd64"
ARG OS="linux"
COPY .build/${OS}-${ARCH}/json_exporter /bin/json_exporter

EXPOSE 7979
USER nobody
ENTRYPOINT [ "/bin/bind_exporter" ]
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ all::

# Needs to be defined before including Makefile.common to auto-generate targets
DOCKER_ARCHS ?= amd64 armv7 arm64 ppc64le
DOCKER_REPO ?= prometheuscommunity

include Makefile.common

Expand Down
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
json_exporter
========================
[![CircleCI](https://circleci.com/gh/prometheus-community/json_exporter.svg?style=svg)](https://circleci.com/gh/prometheus-community/json_exporter)

A [prometheus](https://prometheus.io/) exporter which scrapes remote JSON by JSONPath.

Build
=====
# Build

```sh
./gow get .
./gow build -o json_exporter .
make build
```

Example Usage
=============
# Example Usage

```sh
$ cat example/data.json
{
Expand Down Expand Up @@ -68,7 +68,16 @@ example_value_count{environment="beta",id="id-A"} 1
example_value_count{environment="beta",id="id-C"} 3
```

See Also
========
# Docker

```console
docker run \
-v config.yml:/config.yml
json_exporter \
http://example.com/target.json \
/config.yml
```

# See Also
- [kawamuray/jsonpath](https://github.com/kawamuray/jsonpath#path-syntax) : For syntax reference of JSONPath.
Originally forked from nicksardo/jsonpath(now is https://github.com/NodePrime/jsonpath).
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/kawamuray/jsonpath v0.0.0-20160208140654-5c448ebf9735
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/common v0.9.1
github.com/prometheus/procfs v0.0.11 // indirect
github.com/sirupsen/logrus v1.5.0
github.com/urfave/cli v1.22.4
Expand Down
6 changes: 5 additions & 1 deletion jsonexporter/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@

package jsonexporter

const Version = "0.0.2"
import (
"github.com/prometheus/common/version"
)

var Version = version.Version