Skip to content

Commit

Permalink
update configuring_links (flyteorg#905)
Browse files Browse the repository at this point in the history
* update configuring_links

Fixes flyteorg/flyte#2820
Signed-off-by: SmritiSatyanV [email protected]

* update configuring links

Changes based on review
Signed-off-by: SmritiSatyanV [email protected]
  • Loading branch information
SmritiSatyanV authored Oct 4, 2022
1 parent c395a5d commit 1e87501
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions cookbook/deployment/configure_logging_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
Configuring Logging Links in UI
-------------------------------
Oftentimes to debug your workflows in production, you want to access logs from your tasks as they run.
To debug your workflows in production, you want to access logs from your tasks as they run.
These logs are different from the core Flyte platform logs, are specific to execution, and may vary from plugin to plugin;
for example, Spark may have driver and executor logs.
Every organization potentially uses different log aggregators, making it hard to create a one-size-fits-all solution.
Some examples of the log aggregators include cloud-hosted solutions like AWS CloudWatch, GCP Stackdriver, Splunk, Datadog, etc.
Flyte does not have an opinion here and provides a simplified interface to configure your log provider. Flyte-sandbox
ships with the Kubernetes dashboard to visualize the logs. This may not be safe for production; hence we recommend users
Flyte provides a simplified interface to configure your log provider. Flyte-sandbox
ships with the Kubernetes dashboard to visualize the logs. This may not be safe for production, hence we recommend users
explore other log aggregators.
How Do I configure?
^^^^^^^^^^^^^^^^^^^^
How to configure?
^^^^^^^^^^^^^^^^^
To configure your log provider, the provider needs to support `URL` links that are shareable and can be templatized.
The templating engine has access to `these <https://github.com/flyteorg/flyteplugins/blob/b0684d97a1cf240f1a44f310f4a79cc21844caa9/go/tasks/pluginmachinery/tasklog/plugin.go#L7-L16>`_ parameters.
Expand Down Expand Up @@ -60,6 +60,24 @@
- "https://some-other-source/home?region=us-east-1#logEventViewer:group=/flyte-production/kubernetes;stream=var.log.containers.{{.podName}}_{{.namespace}}_{{.containerName}}-{{.containerId}}.log"
messageFormat: "json" # "unknown" | "csv" | "json"
.. tip::
Since helm chart uses the same templating syntax for args (like ``{{ }}``), compiling the chart results in helm replacing Flyte log link templates as well. To avoid this, you can use escaped templating for Flyte logs in the helm chart.
This ensures that Flyte log link templates remain in place during helm chart compilation.
For example:
If your configuration looks like this:
``https://someexample.com/app/podName={{ "{{" }} .podName {{ "}}" }}&containerName={{ .containerName }}``
Helm chart will generate:
``https://someexample.com/app/podName={{.podName}}&containerName={{.containerName}}``
Flytepropeller pod would be created as:
``https://someexample.com/app/podName=pname&containerName=cname``
This code snippet will output two logs per task that use the log plugin.
However, not all task types use the log plugin; for example, the Sagemaker plugin uses the log output provided by Sagemaker, and the Snowflake plugin will use a link to the snowflake console.
However, not all task types use the log plugin; for example, the SageMaker plugin uses the log output provided by Sagemaker, and the Snowflake plugin will use a link to the snowflake console.
"""

0 comments on commit 1e87501

Please sign in to comment.