argoproj / argo-rollouts

Progressive Delivery for Kubernetes
https://argo-rollouts.readthedocs.io/
Apache License 2.0
2.69k stars 841 forks source link

Convenience variables for time #405

Open jessesuen opened 4 years ago

jessesuen commented 4 years ago

DataDog requires some time information as part of it's queries:

https://docs.datadoghq.com/api/?lang=bash#query-timeseries-points

Rollouts should provide some convenience variables so that the deployment times can be passed to the query to the metric provider. The caveat is that the time format which DataDog wants the time to be in is in unix epoch, which is different than what other metric providers might want.

Recently we added {{experiment.availableAt}} and {{experiment.finishedAt}}, but:

  1. we need more (e.g. {{rollout.deployedAt}}, {{analysis.startedAt}})
  2. provide ways to convert the time into other formats that a metric provider wants.

In Argo workflows, we supported strftime to convert timestamps to other formats: https://github.com/argoproj/argo/blob/master/docs/workflow-controller-configmap.yaml#L62

We could introduce something similar to rollouts/analysis, e.g. {{analysis.startedAt.s}} would provide the analysis start time in unix epoch, since .s is the strftime representation of unix epoch.

johnkost commented 4 years ago

We have this same problem. Not sure how to tackle it yet as we need to provide start/end time for our metrics query

johnkost commented 4 years ago

@jessesuen - I'm looking at tackling this but curious the scope of it. The first stab could be adding {{rollout.deployedAt}} and {{analysis.startedAt}} (this allows me to compare all metrics between rollout and when the analysis was started which shouldn't be until after the pod is healthy).

Can I move time conversion to another issue?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity.