diff --git a/influx.go b/influx.go index 37b3d1b..6690996 100644 --- a/influx.go +++ b/influx.go @@ -91,7 +91,7 @@ func (i *InfluxOutput) LineprotocolFormat(res []*io_prometheus_client.MetricFami // Get prefix for transforming prometheus name to influx. namePrefix := namespace + "_" - enc.SetPrecision(lineprotocol.Microsecond) + enc.SetPrecision(lineprotocol.Nanosecond) now := time.Now() if !i.OverrideTimestamp.IsZero() { now = i.OverrideTimestamp diff --git a/test/influx.lp b/test/influx.lp index ab2b320..481d5c9 100644 --- a/test/influx.lp +++ b/test/influx.lp @@ -1,36 +1,36 @@ -freeipa,host=ipa1.example.com config_dna_range=1 1136214245000000 -freeipa,host=ipa1.example.com config_ipa_ca_issued_cert=1 1136214245000000 -freeipa,host=ipa1.example.com config_ipa_ca_issued_ldap_cert=0 1136214245000000 -freeipa,host=ipa1.example.com config_ipa_cert_auto_renew=1 1136214245000000 -freeipa,host=ipa1.example.com config_ipa_earliest_cert_expiry=2.639495644e+09 1136214245000000 -freeipa,host=ipa1.example.com config_krb5_auth=1 1136214245000000 -freeipa,host=ipa1.example.com config_krb5_workers=0 1136214245000000 -freeipa,host=ipa1.example.com config_ldap_cert_auto_renew=0 1136214245000000 -freeipa,host=ipa1.example.com config_ldap_earliest_cert_expiry=0 1136214245000000 -freeipa,host=ipa1.example.com config_proxy_secret=1 1136214245000000 -freeipa,host=ipa1.example.com config_renewal_master=1 1136214245000000 -freeipa,host=ipa1.example.com failures_total=0 1136214245000000 -freeipa,host=ipa1.example.com freeipa_failed_tests=1 1136214245000000 -freeipa,host=ipa1.example.com ldap_certificate_total=0 1136214245000000 -freeipa,host=ipa1.example.com ldap_conflicts_total=0 1136214245000000 -freeipa,host=ipa1.example.com ldap_dns_zone_total=0 1136214245000000 -freeipa,host=ipa1.example.com ldap_failures_total=0 1136214245000000 -freeipa,host=ipa1.example.com ldap_ghost_replica_total=0 1136214245000000 -freeipa,host=ipa1.example.com ldap_group_total=3 1136214245000000 -freeipa,host=ipa1.example.com ldap_hbac_rule_total=1 1136214245000000 -freeipa,host=ipa1.example.com ldap_host_group_total=2 1136214245000000 -freeipa,host=ipa1.example.com ldap_host_total=4 1136214245000000 -freeipa,host=ipa1.example.com ldap_net_group_total=0 1136214245000000 -freeipa,host=ipa1.example.com,replica=ipa2.example.com ldap_replica_error_code=0 1136214245000000 -freeipa,host=ipa1.example.com,replica=ipa3.example.com ldap_replica_error_code=0 1136214245000000 -freeipa,host=ipa1.example.com,replica=ipa2.example.com ldap_replica_last_update=1.693362478e+09 1136214245000000 -freeipa,host=ipa1.example.com,replica=ipa3.example.com ldap_replica_last_update=1.693362636e+09 1136214245000000 -freeipa,host=ipa1.example.com ldap_scrapes_total=1 1136214245000000 -freeipa,host=ipa1.example.com ldap_service_total=6 1136214245000000 -freeipa,host=ipa1.example.com ldap_sudo_rule_total=0 1136214245000000 -freeipa,host=ipa1.example.com ldap_up=1 1136214245000000 -freeipa,host=ipa1.example.com ldap_user_active_total=7 1136214245000000 -freeipa,host=ipa1.example.com ldap_user_preserved_total=3 1136214245000000 -freeipa,host=ipa1.example.com ldap_user_stage_total=1 1136214245000000 -freeipa,host=ipa1.example.com scrapes_total=1 1136214245000000 -freeipa,host=ipa1.example.com up=1 1136214245000000 +freeipa,host=ipa1.example.com config_dna_range=1 1136214245000000000 +freeipa,host=ipa1.example.com config_ipa_ca_issued_cert=1 1136214245000000000 +freeipa,host=ipa1.example.com config_ipa_ca_issued_ldap_cert=0 1136214245000000000 +freeipa,host=ipa1.example.com config_ipa_cert_auto_renew=1 1136214245000000000 +freeipa,host=ipa1.example.com config_ipa_earliest_cert_expiry=2.639495644e+09 1136214245000000000 +freeipa,host=ipa1.example.com config_krb5_auth=1 1136214245000000000 +freeipa,host=ipa1.example.com config_krb5_workers=0 1136214245000000000 +freeipa,host=ipa1.example.com config_ldap_cert_auto_renew=0 1136214245000000000 +freeipa,host=ipa1.example.com config_ldap_earliest_cert_expiry=0 1136214245000000000 +freeipa,host=ipa1.example.com config_proxy_secret=1 1136214245000000000 +freeipa,host=ipa1.example.com config_renewal_master=1 1136214245000000000 +freeipa,host=ipa1.example.com failures_total=0 1136214245000000000 +freeipa,host=ipa1.example.com freeipa_failed_tests=1 1136214245000000000 +freeipa,host=ipa1.example.com ldap_certificate_total=0 1136214245000000000 +freeipa,host=ipa1.example.com ldap_conflicts_total=0 1136214245000000000 +freeipa,host=ipa1.example.com ldap_dns_zone_total=0 1136214245000000000 +freeipa,host=ipa1.example.com ldap_failures_total=0 1136214245000000000 +freeipa,host=ipa1.example.com ldap_ghost_replica_total=0 1136214245000000000 +freeipa,host=ipa1.example.com ldap_group_total=3 1136214245000000000 +freeipa,host=ipa1.example.com ldap_hbac_rule_total=1 1136214245000000000 +freeipa,host=ipa1.example.com ldap_host_group_total=2 1136214245000000000 +freeipa,host=ipa1.example.com ldap_host_total=4 1136214245000000000 +freeipa,host=ipa1.example.com ldap_net_group_total=0 1136214245000000000 +freeipa,host=ipa1.example.com,replica=ipa2.example.com ldap_replica_error_code=0 1136214245000000000 +freeipa,host=ipa1.example.com,replica=ipa3.example.com ldap_replica_error_code=0 1136214245000000000 +freeipa,host=ipa1.example.com,replica=ipa2.example.com ldap_replica_last_update=1.693362478e+09 1136214245000000000 +freeipa,host=ipa1.example.com,replica=ipa3.example.com ldap_replica_last_update=1.693362636e+09 1136214245000000000 +freeipa,host=ipa1.example.com ldap_scrapes_total=1 1136214245000000000 +freeipa,host=ipa1.example.com ldap_service_total=6 1136214245000000000 +freeipa,host=ipa1.example.com ldap_sudo_rule_total=0 1136214245000000000 +freeipa,host=ipa1.example.com ldap_up=1 1136214245000000000 +freeipa,host=ipa1.example.com ldap_user_active_total=7 1136214245000000000 +freeipa,host=ipa1.example.com ldap_user_preserved_total=3 1136214245000000000 +freeipa,host=ipa1.example.com ldap_user_stage_total=1 1136214245000000000 +freeipa,host=ipa1.example.com scrapes_total=1 1136214245000000000 +freeipa,host=ipa1.example.com up=1 1136214245000000000