Skip to content
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

m3-query: scalar operator on timestamp yielding wrong result #1878

Closed
stevehorsfield opened this issue Aug 14, 2019 · 0 comments · Fixed by #1888
Closed

m3-query: scalar operator on timestamp yielding wrong result #1878

stevehorsfield opened this issue Aug 14, 2019 · 0 comments · Fixed by #1888

Comments

@stevehorsfield
Copy link

Service: m3-query

Context

I'm trying to build a Grafana single-stat panel that shows the number of seconds since the last successful Prometheus configuration reload.

Problem statement

The following query works against Prometheus:

time() - prometheus_config_last_reload_success_timestamp_seconds

At the time of writing, the result coming back is around 900 seconds.

Aganst M3, the result is negative 63.7 billion!

Response data

{
  "xhrStatus": "complete",
  "request": {
    "method": "GET",
    "url": "api/datasources/proxy/6/api/v1/query?query=time()%20-%20prometheus_config_last_reload_success_timestamp_seconds&time=1565795507"
  },
  "response": {
    "status": "success",
    "data": {
      "resultType": "vector",
      "result": [
        {
          "metric": {
            "application": "prometheus",
            "ec2_availability_zone": "us-east-1a",
            "instance": "REDACTED",
            "job": "prometheus:ec2-discovery"
          },
          "value": [
            1565795507,
            "-63701391334.34311"
          ],
          "values": [
            [
              1565795507,
              "-63701391334.34311"
            ]
          ]
        },
        {
          "metric": {
            "application": "prometheus",
            "ec2_availability_zone": "us-east-1b",
            "instance": "REDACTED",
            "job": "prometheus:ec2-discovery"
          },
          "value": [
            1565795507,
            "-63701391324.18791"
          ],
          "values": [
            [
              1565795507,
              "-63701391324.18791"
            ]
          ]
        },
        {
          "metric": {
            "application": "prometheus",
            "ec2_availability_zone": "us-east-1c",
            "instance": "REDACTED",
            "job": "prometheus:ec2-discovery"
          },
          "value": [
            1565795507,
            "-63701391318.88583"
          ],
          "values": [
            [
              1565795507,
              "-63701391318.88583"
            ]
          ]
        }
      ]
    }
  }
}

Verification

Executing this query directly against Prometheus yields the expected outcome.

M3 Configuration

Placement

{
    "num_shards": 32,
    "replication_factor": 3,
    "instances": [
        {
            "id": "m3-data0.domain",
            "isolation_group": "us-east-1a",
            "zone": "embedded",
            "weight": 100,
            "endpoint": "m3-data0.domain:9000",
            "hostname": "m3-data0.domain",
            "port": 9000
        },
        {
            "id": "m3-data1.domain",
            "isolation_group": "us-east-1b",
            "zone": "embedded",
            "weight": 100,
            "endpoint": "m3-data1.domain:9000",
            "hostname": "m3-data1.domain",
            "port": 9000
        },
        {
            "id": "m3-data2.domain",
            "isolation_group": "us-east-1c",
            "zone": "embedded",
            "weight": 100,
            "endpoint": "m3-data2.domain:9000",
            "hostname": "m3-data2.domain",
            "port": 9000
        }
    ]
}

Namespaces

{
  "name": "default",
  "options": {
    "bootstrapEnabled": true,
    "flushEnabled": true,
    "writesToCommitLog": true,
    "cleanupEnabled": true,
    "snapshotEnabled": true,
    "repairEnabled": false,
    "retentionOptions": {
      "retentionPeriodDuration": "792h",
      "blockSizeDuration": "3h",
      "bufferFutureDuration": "10m",
      "bufferPastDuration": "10m",
      "blockDataExpiry": true,
      "blockDataExpiryAfterNotAccessPeriodDuration": "5m"
    },
    "indexOptions": {
      "enabled": true,
      "blockSizeDuration": "6h"
    }
  }
}
{
    "namespaceName": "agg_100days_1h",
    "retentionTime": "2400h"
}
{
    "namespaceName": "agg_1year_4h",
    "retentionTime": "17520h"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant