Skip to content

Change comments in line protocol syntax to be self-descriptive # - #5821

Closed
maximal wants to merge 1 commit into
influxdata:masterfrom
maximal:patch-1
Closed

Change comments in line protocol syntax to be self-descriptive ##5821
maximal wants to merge 1 commit into
influxdata:masterfrom
maximal:patch-1

Conversation

@maximal

@maximal maximal commented Feb 4, 2025

Copy link
Copy Markdown
Contributor

I suppose, the current

// Syntax
<measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]] <field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]

// Example
myMeasurement,tag1=value1,tag2=value2 fieldKey="fieldValue" 1556813561098000000

can confuse new users by implying that // can be used to comment lines in the line protocol itself.

So, I propose to change this snippet to

# Syntax
<measurement>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]] <field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]

# Example
myMeasurement,tag1=value1,tag2=value2 fieldKey="fieldValue" 1556813561098000000

and use some #-comment language descriptor in the Markdown code block (like Python).

@maximal maximal changed the title Change comments in line protocol syntacs to be self-descriptive # Change comments in line protocol syntax to be self-descriptive # Feb 4, 2025
@jstirnaman
jstirnaman marked this pull request as draft August 19, 2026 19:07
@jstirnaman

Copy link
Copy Markdown
Contributor

If we do this for one product, we should do it for all.

jstirnaman added a commit that referenced this pull request Aug 25, 2026
#7678 and #5821 fixed the misleading `js`/`//` comment syntax in the
line protocol "Syntax" block, but relabeled it `python`, which is
still not what the block is (a placeholder grammar, not runnable
Python or JS). Split each occurrence into a `text` fence for the
placeholder syntax and a standalone `lp` fence for the real example,
matching this repo's line-protocol fence convention. Also fixed the
several other `js`/`sh`-tagged blocks in the same two shared files
that are real, standalone line protocol (not templates) to use `lp`,
since they were failing codeblock lint as invalid JavaScript.

PR #5821 targeted content/influxdb/v2/reference/syntax/line-protocol.md,
which is now a stub whose body is sourced from
content/shared/influxdb-v2/reference/syntax/line-protocol.md; applied
its intent to the shared file instead.

Co-authored-by: MaximAL <almaximal@gmail.com>
@jstirnaman

Copy link
Copy Markdown
Contributor

Thanks for the fix! Folded into #7705, which also splits the syntax template from the runnable example (so it's not mislabeled as python either) and applies your fix to the shared source file this content now lives in (content/shared/influxdb-v2/reference/syntax/line-protocol.md — the file this PR targets became a stub pointing there). Your commit is preserved in that branch's history and credited via co-author trailer. Closing this in favor of #7705.

@jstirnaman jstirnaman closed this Aug 25, 2026
@maximal

maximal commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@jstirnaman, thanks!

jstirnaman pushed a commit that referenced this pull request Aug 25, 2026
jstirnaman added a commit that referenced this pull request Aug 25, 2026
#7678 and #5821 fixed the misleading `js`/`//` comment syntax in the
line protocol "Syntax" block, but relabeled it `python`, which is
still not what the block is (a placeholder grammar, not runnable
Python or JS). Split each occurrence into a `text` fence for the
placeholder syntax and a standalone `lp` fence for the real example,
matching this repo's line-protocol fence convention. Also fixed the
several other `js`/`sh`-tagged blocks in the same two shared files
that are real, standalone line protocol (not templates) to use `lp`,
since they were failing codeblock lint as invalid JavaScript.

PR #5821 targeted content/influxdb/v2/reference/syntax/line-protocol.md,
which is now a stub whose body is sourced from
content/shared/influxdb-v2/reference/syntax/line-protocol.md; applied
its intent to the shared file instead.

Co-authored-by: MaximAL <almaximal@gmail.com>
jstirnaman pushed a commit that referenced this pull request Aug 25, 2026
jstirnaman added a commit that referenced this pull request Aug 25, 2026
#7678 and #5821 fixed the misleading `js`/`//` comment syntax in the
line protocol "Syntax" block, but relabeled it `python`, which is
still not what the block is (a placeholder grammar, not runnable
Python or JS). Split each occurrence into a `text` fence for the
placeholder syntax and a standalone `lp` fence for the real example,
matching this repo's line-protocol fence convention. Also fixed the
several other `js`/`sh`-tagged blocks in the same two shared files
that are real, standalone line protocol (not templates) to use `lp`,
since they were failing codeblock lint as invalid JavaScript.

PR #5821 targeted content/influxdb/v2/reference/syntax/line-protocol.md,
which is now a stub whose body is sourced from
content/shared/influxdb-v2/reference/syntax/line-protocol.md; applied
its intent to the shared file instead.

Co-authored-by: MaximAL <almaximal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants