Impact 2024: The Industrial Data and AI Conference for and by Users | Nominate Speakers Now for a Ch...
It seems to be related to flake moving from gitlab to github.https://www.reddit.com/r/Python/comments/yvfww8/flake8_took_down_the_gitlab_repository_in_favor/I will update the pre-commit in your repo to see if it helps. It’s not related to being a personal repo.
There is a limit on synthetic time series as well, so even though if the Grafana plugin would fetch >1000 time series to do the average over it would not work with your current design.avg(ts{assetSubtreeIds=xxx})https://docs.cognite.com/dev/concepts/resource_types/synthetic_timeseries/In a single request, you can ask for:10 expressions (10 synthetic time series). 10.000 data points, summed over all expressions. 100 input time series referrals, summed over all expressions. 2000 tokens in each expression. Similar to 2000 characters, except that words and numbers are counted as a single character.You will reach multiple of these limitations.The current recommendation is to create a Cognite Function that creates the average across the subtree and write the result to a new time series you can visualize in Grafana.In addition, we could move your current request into a feature request.
Hello,The Cognite Grafana plugin doesn’t do cursor API queries basically due to user friendliness and performance.Assuming this is about the variables created with asset queries; A dropdown with >1000 items will be very hard to navigate. Having more items will also make it slow. Is it possible to filter the assets to make the list of assets shorter? Displaying more than 1000 timeseries in one small widget will be hard to read and take time to calculate (slow). Does it make sense from the user’s perspective? We recommend splitting the time series into multiple widgets.
Can you share more of the stacktrace? Does it still work?
HiI’m not sure if it solves your problem, but you should remove the “cognite-sdk-core” package. With SDK >v4 it was removed so it might cause issues to have both packages installed.Are you running the code behind a firewall/proxy?
No. You will only get the token from the client. You can name it with shorter name and use the mapping described in my previous answer.
Your code it correct, the token will be in the result from app.acquire_token_for_clientComplete code:import msalapp = msal.ConfidentialClientApplication( client_id="<client id>", authority="https://login.microsoftonline.com/<tenantid>", client_credential="<secret>" )result = app.acquire_token_for_client(scopes=["<scope>"])token = result['access_token']
You shouldn’t add _SECRET unless you also update the code. In any case it will be too long so it could be worked around by creating a map in the handler.py:Create secrets in config.yaml+GitHub- COUNT_API_PROD, COUNT_API_TESTIn handler.py:secret_map = {"count-api-accenture-operations-twin":"count-api-prod"}def handle(client, data, secrets): print(f"Hello world from Cognite Functions @ {datetime.now()}!") some_secret = secrets[secret_map[f"some-secret-{client.config.project}"]] # use secret
To get environment specific secrets you could create them as a GitHub secret and concatenate the CDF project name to the secret name.If you have cdf-project-a and cdf-project-b create two secrets in GitHub;SOME_SECRET_CDF_PROJECT_A and SOME_SECRET_CDF_PROJECT_B In config.yaml for your function add a list of secrets under modelSettings/secrets:modelSettings:... secrets: - SOME_SECRET_CDF_PROJECT_A - SOME_SECRET_CDF_PROJECT_BIn you handler.py:def handle(client, data, secrets): print(f"Hello world from Cognite Functions @ {datetime.now()}!") some_secret = secrets[f"some-secret-{client.config.project}"] # use secretThe token used against CDF can be fetched using client.config.token(). Please notice that the scope is CDF specific and might not work againt a 3rd party service requiring a different scope.
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.