{"id":13530472,"url":"https://github.com/davidB/metrics-influxdb","last_synced_at":"2025-04-01T18:31:51.675Z","repository":{"id":13738080,"uuid":"16432430","full_name":"davidB/metrics-influxdb","owner":"davidB","description":"A reporter for metrics which announces measurements to an InfluxDB server.","archived":true,"fork":false,"pushed_at":"2023-03-20T05:01:53.000Z","size":256,"stargazers_count":271,"open_issues_count":15,"forks_count":102,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-11-02T17:36:13.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-02-01T10:50:23.000Z","updated_at":"2024-09-12T12:15:04.000Z","dependencies_parsed_at":"2024-01-07T12:51:48.517Z","dependency_job_id":"fae71433-65d0-4115-9a25-6697509148a2","html_url":"https://github.com/davidB/metrics-influxdb","commit_stats":null,"previous_names":["novaquark/metrics-influxdb"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fmetrics-influxdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fmetrics-influxdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fmetrics-influxdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidB%2Fmetrics-influxdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidB","download_url":"https://codeload.github.com/davidB/metrics-influxdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246691614,"owners_count":20818542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:00:50.344Z","updated_at":"2025-04-01T18:31:51.281Z","avatar_url":"https://github.com/davidB.png","language":"Java","funding_links":[],"categories":["Collecting data into InfluxDB","指标库"],"sub_categories":["Plugins","Spring Cloud框架"],"readme":"\u003cp xmlns:dct=\"http://purl.org/dc/terms/\"\u003e\n  \u003ca rel=\"license\"\n     href=\"http://creativecommons.org/publicdomain/zero/1.0/\"\u003e\n    \u003cimg src=\"http://i.creativecommons.org/p/zero/1.0/88x31.png\" style=\"border-style: none;\" alt=\"CC0\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n  To the extent possible under law,\n  \u003ca rel=\"dct:publisher\"\n     href=\"https://github.com/orgs/novaquark\"\u003e\n    \u003cspan property=\"dct:title\"\u003eNovaquark\u003c/span\u003e\u003c/a\u003e\n  has waived all copyright and related or neighboring rights to\n  this work.\n\u003c/p\u003e\n\n[![Build Status](https://travis-ci.org/davidB/metrics-influxdb.svg?branch=master)](https://travis-ci.org/davidB/metrics-influxdb)\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/davidB/metrics-influxdb/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n[![Download](https://api.bintray.com/packages/davidb/maven/metrics-influxdb/images/download.svg) ](https://bintray.com/davidb/maven/metrics-influxdb/_latestVersion)\n\n# The library provide :\n\n* a lighter client than influxdb-java to push only series to an [InfluxDB](http://influxdb.org) server.\n* A reporter for [metrics](http://metrics.codahale.com/) which announces measurements.\n\nThe library provide a lighter client than influxdb-java to push only metrics.\n\n## Dependencies :\n\n* slf4j-api for logging.\n* metrics-core, to provide, if you use InfluxdbReporter.\n\n## Install:\n\n### Released\n```\n dependencies {\n\tcompile 'com.github.davidb:metrics-influxdb:0.9.3'\n }\n```\n\n### Dev\n```\n repositories {\n    maven { url \"https://jitpack.io\" }\n }\n dependencies {\n\tcompile 'com.github.davidb:metrics-influxdb:-SNAPSHOT'\n }\n```\n## Usage :\n\nUsing the Builder API and its defaults, it is easy to use InfluxdbReporter:\n\n    ScheduledReporter reporter = InfluxdbReporter.forRegistry(registry).build();\n    reporter.start(10, TimeUnit.SECONDS);\n\nWith the previous simple configuration, all defaults will be used, mainly:\n\n- protocol: `HTTP`\n- server: `127.0.0.1`\n- port: `8086`\n- authentication: `none`\n- database name: `metrics`\n- rates: converted to `TimeUnit.SECONDS`\n- duration: converted to `TimeUnit.MILLISECONDS`\n- idle metrics: `do not report`\n- influxdb protocol: `v09` [line protocol](https://influxdb.com/docs/v0.9/write_protocols/line.html)\n- ...\n\nBut you are free of course to define all settings by yourself :\n```\nfinal ScheduledReporter reporter = InfluxdbReporter.forRegistry(registry)\n    .protocol(new HttpInfluxdbProtocol(\"http\", \"influxdb-server\", 8086, \"admin\", \"53CR3TP455W0RD\", \"metrics\"))\n    .convertRatesTo(TimeUnit.SECONDS)\n    .convertDurationsTo(TimeUnit.MILLISECONDS)\n    .filter(MetricFilter.ALL)\n    .skipIdleMetrics(false)\n    .tag(\"cluster\", \"CL01\")\n    .tag(\"client\", \"OurImportantClient\")\n    .tag(\"server\", serverIP)\n    .transformer(new CategoriesMetricMeasurementTransformer(\"module\", \"artifact\"))\n    .build();\nreporter.start(10, TimeUnit.SECONDS);\n```\n\nAnd if you are still using v08 influxdb\n\n```\nfinal InfluxdbReporter reporter = InfluxdbReporter\n    .forRegistry(registry)\n    .protocol(new HttpInfluxdbProtocol(\"influxdb-server\", 8086, \"admin\", \"53CR3TP455W0RD\", \"metrics\"))\n    .v08()\n    .build();\n...\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FdavidB%2Fmetrics-influxdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FdavidB%2Fmetrics-influxdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FdavidB%2Fmetrics-influxdb/lists"}