Skip to content

Update examples in the Dynatrace documentation #27502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

pirgeo
Copy link
Contributor

@pirgeo pirgeo commented Jul 27, 2021

This PR updates the documentation to include Spring Placeholder notation for the v2 exporter in order to make the setup process even easier.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 27, 2021
@jonatan-ivanov
Copy link
Member

@wilkinsona This is slightly related to the recent Dynatrace changes in Boot and Micrometer (that we released today). Do you think we can merge these doc improvements before 2.6.0-M2?

Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR but I am not keen to add additional information in the form of comments in the example without a good reason to.

If that's important, perhaps we should have two examples, each of them describing the differences in text rather than in the configuration itself. Please note that those comments are not rendered with the properties format.

The use of spring placeholder is not warranted IMO. It is a general feature that is applicable to any property.

uri: "https://{your-environment-id}.live.dynatrace.com/api/v2/metrics/ingest"
api-token: "YOUR_TOKEN" # should be read from a secure source and not hard-coded.
# uri: "https://{your-environment-id}.live.dynatrace.com/api/v2/metrics/ingest" # for SaaS
# uri: "https://{your-domain}/e/{your-environment-id}/api/v2/metrics/ingest" # for managed deployments
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not keen to provide multiple options in the same example. These are not rendered for properties anyway and it feels like this is something that should be described rather than being put in the example directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here was that users could just copy the example and remove the # for the option they want to use.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK but that doesn't address my previous comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I might have missed something here. Do I understand correctly that the comments within the code blocks will not show up in the documentation at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snicoll, Is there something I missed here? Would you be able to provide some guidance on how to proceed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that the comments within the code blocks will not show up in the documentation at all?

There are not for properties. You can figure that out yourself by looking at the current documentation. We render the snippet in both yml and properties format. The latter doesn't have the comment. Ideally I'd like to rework those samples irrespective of this PR to remove the comment so I am not keen to add more comments.

Would you be able to provide some guidance on how to proceed?

From my perspective, it boils down to my first comment, specifically "it feels like this is something that should be described rather than being put in the example directly.". If we feel these are important enough examples to document, the different options should be described in text with some context, rather than in a comment of a snippet. I've flagged for team attention to get more feedback from the team.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 57bd19f I moved the additional information to text paragraphs, either way is fine with me. The comments that still persist are optional, meaning that users that copy from the properties format still get the expected behavior, but in the yml format, they provide additional information.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should aim to treat users equally, irrespective of the format that they choose to use for configuration files. If the additional information is needed, I don't think it should be hidden in a comment that's only visible if you're using YAML.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wilkinsona I have removed all comments, except for one that is only relevant for users of the YAML format. Thanks for explaining this, I did not realize that they would not show up in the properties file.

api-token: "YOUR_TOKEN" # should be read from a secure source and not hard-coded.
# uri: "https://{your-environment-id}.live.dynatrace.com/api/v2/metrics/ingest" # for SaaS
# uri: "https://{your-domain}/e/{your-environment-id}/api/v2/metrics/ingest" # for managed deployments
# or use the Spring placeholder notation to read it from an environment variable:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is warranted. Any property can be used with such a placeholder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some user's environments this particular property will already be populated. I didn't want to lay out in which cases this applies since that's subject to change and likely too detailed for these docs. How about this?

# If the DT_METRICS_INGEST_URL and DT_METRICS_INGEST_API_TOKEN are populated in your environment, you can use these with the Spring placeholder notation:
uri: ${DT_METRICS_INGEST_URL}
# should be read from a secure source and not hard-coded.
api-token: ${DT_METRICS_INGEST_API_TOKEN}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be read from a secure source and not hard-coded

I don't think this is necessary. There are numerous properties mentioned elsewhere in the documentation where this is the case and we don't have such a comment for each of them.

@@ -194,7 +198,11 @@ When using the Dynatrace v2 API, the following optional features are available:
metrics:
export:
dynatrace:
# specify token and uri or leave blank for OneAgent export
# Specify API token and URI or leave blank for OneAgent export, e.g.:
# uri: ${DT_METRICS_INGEST_URL}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, nothing particular about these properties.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Aug 16, 2021
@snicoll snicoll added the for: team-meeting An issue we'd like to discuss as a team to make progress label Sep 4, 2021
@philwebb philwebb added type: documentation A documentation update and removed for: team-meeting An issue we'd like to discuss as a team to make progress status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Sep 22, 2021
@philwebb philwebb added this to the 2.6.x milestone Sep 22, 2021
Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I am still not sure we should document the DT_METRICS_* properties. I don't know how and when it would apply to a user reading the doc...

api-token: "YOUR_TOKEN"
----

Depending on your setup, the environment variables `+DT_METRICS_INGEST_URL+` and `+DT_METRICS_INGEST_API_TOKEN+` might be populated accordingly already and can be used via the Spring placeholder notation:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "depending on your setup" mean? I think that if something is setting those, perhaps we should link to whatever is setting them rather and put that doc there? I am mentioning this as I would prefer that our documentation does not provide too much information for something that would be better covered elsewhere anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snicoll I have removed the example for now since I don't have any good reference to put into the docs. Thanks for pointing out that that might be unclear for readers!

@pirgeo pirgeo force-pushed the update-dynatrace-documentation branch from 3bc7a41 to 0c56cea Compare September 28, 2021 15:25
@pirgeo pirgeo force-pushed the update-dynatrace-documentation branch from 0c56cea to 89f0a5c Compare September 28, 2021 15:34
@snicoll snicoll modified the milestones: 2.6.x, 2.6.0-RC1 Sep 30, 2021
@snicoll snicoll self-assigned this Sep 30, 2021
@snicoll snicoll closed this in 8f3353a Sep 30, 2021
@arminru arminru deleted the update-dynatrace-documentation branch September 30, 2021 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants