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

Version 1.3 sets align sampling true always #675

Open
iudeen opened this issue Jan 12, 2023 · 3 comments
Open

Version 1.3 sets align sampling true always #675

iudeen opened this issue Jan 12, 2023 · 3 comments

Comments

@iudeen
Copy link
Contributor

iudeen commented Jan 12, 2023

As per the change here

private boolean m_alignSampling = true;

The m_alignSampling is always set true. This is causing issue when we aggregate across days. As per documentation, align_sampling is false by default.

Query without sampling set to false explicitly

{
    "metrics": [
        {
            "tags": {
                "ex": [
                    "16289"
                ]
            },
            "name": "raw",
            "group_by": [
                {
                    "name": "tag",
                    "tags": [
                        "ex"
                    ]
                }
            ],
            "aggregators": [
                {
                    "name": "sum",
                    "sampling": {
                        "value": "24",
                        "unit": "hours"
                    },
                    "align_end_time": true
                                     }
                
            ]
        }
    ],
    "plugins": [],
    "cache_time": 0,
    "start_absolute": 1672533000000,
    "end_absolute": 1672619399999
}

Results:

 "values": [
                        [
                            1672597800000,
                            0
                        ],
                        [
                            1672684200000,
                            0
                        ]
                    ]

Changing aggregators to

 "aggregators": [
                {
                    "name": "sum",
                    "sampling": {
                        "value": "24",
                        "unit": "hours"
                    },
                    "align_sampling": false,
                    "align_end_time": true
                                     }
                
            ]

Results

"values": [
                        [
                            1672619400000,
                            0
                        ]
                    ]

Which is correct!

@brianhks
Copy link
Member

That part of the documentation is messy. I'll clean it up. The default was changed for good reason. I'll change the documentation to match what is in the code.

@iudeen
Copy link
Contributor Author

iudeen commented Jan 23, 2023

For some reason we get two data points when we aggregate 24 hours.

Making the end time 1ms lesser solves the problem. But any idea why this behavior occurs in the latest version?

@iudeen
Copy link
Contributor Author

iudeen commented Mar 15, 2023

Any update on this?

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

No branches or pull requests

2 participants