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

Add the option to add additional tags when logging to InfluxDB #2613

Merged
merged 1 commit into from Jul 26, 2016

Conversation

Projects
None yet
2 participants
@open-homeautomation
Contributor

open-homeautomation commented Jul 24, 2016

Description: Adds an option to set additional tags when logging to InfluxDB

This can be helpful when multiple instances of Home Assistant should log to the same InfluxDB. Setting additional tags allows to distinguish between the different instances.
Using "instance" as a tag is just an example, it is possible to use any tags with any values.

Related issue (if applicable): -

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#

Example entry for configuration.yaml (if applicable):

influxdb:
  host: localhost
  tags:
    instance: prod

Checklist:

If user exposed functionality or configuration variables are added/changed:

If code communicates with devices, web services, or a:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable ([example][ex-requir]).
  • New dependencies are only imported inside functions that use them ([example][ex-import]).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.
@@ -99,6 +101,9 @@ def influx_event_listener(event):
}
]
for tag in tags:

This comment has been minimized.

@balloob

balloob Jul 26, 2016

Member

Alternative:

json_body[0]['tags'].update(tags)
@balloob

balloob Jul 26, 2016

Member

Alternative:

json_body[0]['tags'].update(tags)

This comment has been minimized.

@balloob

balloob Jul 26, 2016

Member

(Just an FYI, no need to fix)

@balloob

balloob Jul 26, 2016

Member

(Just an FYI, no need to fix)

@balloob

This comment has been minimized.

Show comment
Hide comment
@balloob

balloob Jul 26, 2016

Member

Looks good! 🐬

Member

balloob commented Jul 26, 2016

Looks good! 🐬

@balloob balloob merged commit de6f49c into home-assistant:dev Jul 26, 2016

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.007%) to 93.611%
Details
farcy approves! Bravo!

@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017

@open-homeautomation open-homeautomation deleted the open-homeautomation:influx-tag branch Jul 20, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.