Commit Graph

17 Commits

Author SHA1 Message Date
SuperQ
2b8fbee030
Update build
* Update go to 1.20.
* Update Prometheus CI orb.
* Add landing page.
* Update Go modules.
* Update golangci-lint.

Signed-off-by: SuperQ <superq@gmail.com>
2023-04-01 12:06:31 +02:00
Ben Kochie
d1456b8917
Revert "Support Value Conversions (#172)" (#183)
This reverts commit ca1304003c.
2022-10-06 08:45:27 +02:00
ngrebels
ca1304003c
Support Value Conversions (#172)
* Bump k8s.io/client-go from 0.24.2 to 0.24.3 (#171)

Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.24.2 to 0.24.3.
- [Release notes](https://github.com/kubernetes/client-go/releases)
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.24.2...v0.24.3)

---
updated-dependencies:
- dependency-name: k8s.io/client-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: ngrebels <ngrebels@mathworks.com>
Signed-off-by: Yao Hong Kok <yaokok@mathworks.com>

* Bump github.com/prometheus/common from 0.35.0 to 0.37.0 (#170)

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.35.0 to 0.37.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.35.0...v0.37.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: ngrebels <ngrebels@mathworks.com>
Signed-off-by: Yao Hong Kok <yaokok@mathworks.com>

* Added a value converter for dynamic values and associated tests

Signed-off-by: ngrebels <ngrebels@mathworks.com>
Signed-off-by: Yao Hong Kok <yaokok@mathworks.com>

* Refactored into functions and created a type

Signed-off-by: ngrebels <ngrebels@mathworks.com>
Signed-off-by: Yao Hong Kok <yaokok@mathworks.com>

* value converter: added example

Signed-off-by: ngrebels <ngrebels@mathworks.com>
Signed-off-by: Yao Hong Kok <yaokok@mathworks.com>

* Remove underscore from variable name

Signed-off-by: Yao Hong Kok <yaokok@mathworks.com>

* Fix formatting error from merging

Signed-off-by: Yao Hong Kok <yaokok@mathworks.com>

Signed-off-by: ngrebels <ngrebels@mathworks.com>
Signed-off-by: Yao Hong Kok <yaokok@mathworks.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yao Hong Kok <yaokok@mathworks.com>
2022-10-05 18:32:05 +02:00
janphkre
9ecc44b064
Grab Timestamps from Metric (#167)
* Pick timestamp from metric

based on #97 and #80 this provides the posibility to use a metric that has a unix style timestamp as the timestamp of the scraped metric

When deserializing objects we need to take the key json path into account as well like we would do for all the values as well. This allows collections to be defined still with each entry having a separate timestamp (e.g. list of time-stamped log messages).

Update examples for timestamp

Update Readme about staleness for custom timestamps

Signed-off-by: Jan Phillip Kretzschmar <janphkre@gmx.de>
Signed-off-by: Ben Kochie <superq@gmail.com>
Co-authored-by: Ben Kochie <superq@gmail.com>
2022-08-28 13:48:35 +02:00
Alex R
f8ddc2fa84
Add ignore_status (#161)
* Add ignore_status

Signed-off-by: Alexander Ryabov <alexander.ryabov@jetbrains.com>

* Use valid_status_codes slice

Signed-off-by: Alexander Ryabov <alexander.ryabov@jetbrains.com>

Co-authored-by: Alexander Ryabov <alexander.ryabov@jetbrains.com>
2022-07-11 09:08:07 +09:00
Kyle Allan
83189c5e54
use the metric's ValueType (#162)
Signed-off-by: Kyle Allan <kallan357@gmail.com>

Co-authored-by: Kyle Allan <kallan@singularity6.com>
2022-07-01 09:20:07 +02:00
Ben Ye
75ae2b065e
Support modules configuration (#146)
* support modules configuration

Signed-off-by: Ben Ye <ben.ye@bytedance.com>

* fallback default module if the param is missing

Signed-off-by: Ben Ye <ben.ye@bytedance.com>

* update readme and example config file

Signed-off-by: Ben Ye <ben.ye@bytedance.com>

* fix lint

Signed-off-by: Ben Ye <ben.ye@bytedance.com>
2022-05-27 14:47:32 +09:00
Ben Ye
d43d3ed28e
support custom valuetype like counter, gauge or untyped (#145)
* support custom valuetype like counter, gauge or untyped

Signed-off-by: Ben Ye <ben.ye@bytedance.com>
2022-05-23 18:35:44 +02:00
SuperQ
6de63fe83b
Use explicit metric type switching
Avoid side effect behavior by explicitly passing the ScrypeType to the
collector.

Signed-off-by: SuperQ <superq@gmail.com>
2022-05-22 15:32:36 +02:00
SuperQ
eaf94d3a5e
Update build
* Update to Go 1.17.
* Update modules.
* Enable golint CI test.
* Fixup golint issues.

Signed-off-by: SuperQ <superq@gmail.com>
2021-10-05 13:21:42 +02:00
SuperQ
5783a9ca02
Refactor FetchJson
Refactor FetchJson to use a constructor.
* Cleanup nolint to use a a .golangci.yml config.
* Switch go-kit/kit/log to go-kit/log.

Signed-off-by: SuperQ <superq@gmail.com>
2021-10-03 13:30:18 +02:00
Ravi
bd0852bc25
Add support for HTTP POST body content (#123)
* Add support for HTTP POST body content

* Add tests for POST body content

* Code structure refactor for review
2021-10-03 09:30:53 +00:00
SuperQ
6a8afe49e2
Update Go modules
* Update to latest modules.
* Use new syntax for http client[0].

[0]: https://github.com/prometheus/common/pull/291

Signed-off-by: SuperQ <superq@gmail.com>
2021-08-05 11:00:42 +02:00
rustyclock
fe22a839e2
Migrate JSONPath library
Signed-off-by: rustyclock <rustyclock@protonmail.com>
2021-01-24 13:49:10 +09:00
Ben Kochie
d6403b58a8
Release v0.2.0
* Update changelog
* Bump Go modules.
* Update NewClientFromConfig use
* Bump Go to 1.15.

prometheus/common#249 added option to disable HTTP/2.

Signed-off-by: Ben Kochie <superq@gmail.com>
2020-11-02 16:32:28 +01:00
Konstantinos Koukopoulos
1555ed88d4 Fix unchecked call to io.Copy
After #49 was merged to master the build failed due to a linting error:

    GO111MODULE=on /go/bin/golangci-lint run  ./...
    exporter/util.go:162:10: Error return value of `io.Copy` is not checked
    (errcheck)
                    io.Copy(ioutil.Discard, resp.Body)
                           ^
    make: *** [Makefile.common:192: common-lint] Error 1

build failure here:
https://app.circleci.com/pipelines/github/prometheus-community/json_exporter/28/workflows/e2c53db3-d3a3-4faa-a5a6-3b1fbb5754a0/jobs/71

Signed-off-by: Konstantinos Koukopoulos <koukopoulos@aisera.com>
2020-11-02 13:31:20 +02:00
rustyclock
9f94906a18
Change package name from 'internal' to 'exporter'
Signed-off-by: rustyclock <rustyclock@protonmail.com>
2020-10-03 09:03:56 +09:00