13 Jun 2024 03:34 PM - edited 14 Jun 2024 11:13 AM
I ran into a bit of an issue with migrating python extensions from v1 to v2 regarding the endpoint configuration.
The migration docs mention: "You can find and replace all self.config. entries with self.activation_config."
That led to empty fields and when checking out the activation_config I saw it has an array of endpoints with the config values.
That matches the example from Creating a Python extension, where it is iterated over the endpoints from self.activation_config["endpoints"] in the query method.
That would be a bigger change from v1 though, where the extension only knows about its current endpoint. And for a lot of extensions, I wouldn't be able to finish all endpoints in the 1 Minute query window.
Is this just a discrepancy in the docs or am I missing something else here?
Hope someone has a quick pointer, I wasn't able to find anything else in the docs.
Solved! Go to Solution.
14 Jun 2024 08:49 AM
Hey @Nick-Montana
Thanks, but that is not really related to my question about the endpoints of the extension.
The rest of the migration looks pretty straight forward. I'm using metrics v2 in my extensions anyway so v2 will just simplify things there.
14 Jun 2024 10:21 AM
Hi,
You'd indeed have to add the endpoint loop if you want to have more than one endpoint in a monitoring configuration. If you only want one endpoint then that is fine as well. Keep in mind that in EF2.0 there is no 1 minute limitation anymore. Even more, each endpoint runs in its own thread so it's not subsequent.
14 Jun 2024 11:04 AM - edited 14 Jun 2024 11:10 AM
Ah right, that's what I was missing. A lot more flexibility with that model, especially for longer running extensions with a higher interval, great!
Thanks for quick answer Mike!
14 Jun 2024 11:14 AM
The flexibility makes a huge difference indeed. You can even create listeners and such seeing as it's just a python program.
14 Jun 2024 12:27 PM
Thinking about it I got one more question. You wrote Each Endpoint runs in its own thread so it's not subsequent.
Is it each Endpoint or each Monitoring configuration? The Endpoints can't really be separated if I have to iterate over the config in the query?
14 Jun 2024 01:00 PM
The monitoring configurations run in their own process.
Within that process you can spawn many threads, the schedule methods of the SDK handles that automatically for you.