Skip to content

how to remove the unwanted indentation #710

@AbdullahFarhanSafwi

Description

@AbdullahFarhanSafwi

currently I am getting the output of yaml.dump() as like this

 error_query: |2-


                    sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[{{.window}}]))
        total_query: |2-


                    sum(rate(http_request_duration_seconds_count{job="myservice"}[{{.window}}]))

for this piece of code

events: {
          error_query:`\n
          ${sloContextData.errorQuery.trim()}`,
          total_query:`\n
          ${sloContextData.totalQuery.trim()}`,   

what I want is the output to look like this

error_query: |
  sum(rate(http_request_duration_seconds_count{job="myservice",code=~"(5..|429)"}[{{.window}}]))
total_query: |
  sum(rate(http_request_duration_seconds_count{job="myservice"}[{{.window}}]))

Thanks any help is much appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions