forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(outputs.postgresql): add Postgresql output
Functionally, this is the same as influxdata#8651. The differences are two fold right now: 1) tests all use test-containers and right now do not have the ability to use a local postgresql database 2) The tests expecting pguint extension will skip untill the testcontainer startup installs that extension.
- Loading branch information
Showing
21 changed files
with
4,509 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,62 @@ | ||
package all | ||
|
||
import ( | ||
//Blank imports for plugins to register themselves | ||
_ "github.com/influxdata/telegraf/plugins/outputs/amon" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/amqp" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/application_insights" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/azure_data_explorer" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/azure_monitor" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/bigquery" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/cloud_pubsub" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/cloudwatch" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/cloudwatch_logs" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/cratedb" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/datadog" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/discard" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/dynatrace" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/elasticsearch" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/event_hubs" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/exec" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/execd" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/file" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/graphite" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/graylog" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/groundwork" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/health" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/http" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/influxdb" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/influxdb_v2" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/instrumental" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/iotdb" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/kafka" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/kinesis" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/librato" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/logzio" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/loki" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/mongodb" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/mqtt" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/nats" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/newrelic" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/nsq" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/opentelemetry" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/opentsdb" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/postgresql" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/prometheus_client" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/redistimeseries" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/riemann" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/riemann_legacy" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/sensu" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/signalfx" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/socket_writer" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/sql" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/stackdriver" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/stomp" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/sumologic" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/syslog" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/timestream" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/warp10" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/wavefront" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/websocket" | ||
_ "github.com/influxdata/telegraf/plugins/outputs/yandex_cloud_monitoring" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || outputs || outputs.postgresql | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/outputs/postgresql" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This Dockerfile can be used to build an image including the pguint extension. | ||
# | ||
# docker build -t postgres:pguint . | ||
# docker run -d --name postgres -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust postgres:pguint | ||
# docker logs -f postgres 2>&1 | grep -q 'listening on IPv4 address "0.0.0.0", port 5432' | ||
# go test | ||
|
||
# Tag from https://hub.docker.com/_/postgres?tab=tags | ||
ARG POSTGRES_TAG=latest | ||
|
||
ARG PGUINT_REPO | ||
ARG PGUINT_RELEASE | ||
|
||
FROM postgres:${POSTGRES_TAG} | ||
|
||
RUN apt-get update && apt-get install -y build-essential curl postgresql-server-dev-${PG_MAJOR}=${PG_VERSION} | ||
|
||
ENV PGUINT_REPO=${PGUINT_REPO:-phemmer/pguint} | ||
ENV PGUINT_REF=${PGUINT_REF:-fix-getmsgint64} | ||
RUN mkdir /pguint && cd /pguint && \ | ||
curl -L https://github.com/${PGUINT_REPO}/tarball/${PGUINT_REF} | tar -zx --strip-components=1 && \ | ||
make && make install && \ | ||
echo 'CREATE EXTENSION uint;' > /docker-entrypoint-initdb.d/uint.sql && \ | ||
echo '\\c template1' >> /docker-entrypoint-initdb.d/uint.sql && \ | ||
echo 'CREATE EXTENSION uint;' >> /docker-entrypoint-initdb.d/uint.sql | ||
|
Oops, something went wrong.