Skip to content

blog article #03: Visualizing Nginx Access Logs using Timeplus and Grafana#798

Merged
jovezhong merged 57 commits intotimeplus-io:developfrom
ayewo:blog/03_nginx-grafana-metabase
Jul 23, 2024
Merged

blog article #03: Visualizing Nginx Access Logs using Timeplus and Grafana#798
jovezhong merged 57 commits intotimeplus-io:developfrom
ayewo:blog/03_nginx-grafana-metabase

Conversation

@ayewo
Copy link
Copy Markdown
Contributor

@ayewo ayewo commented Jul 7, 2024

PR checklist:

  • Did you run ClangFormat ? N/A
  • Did you separate headers to a different section in existing community code base ? N/A
  • Did you surround proton: starts/ends for new code in existing community code base ? N?A

Please write user-readable short description of the changes:

@jovezhong jovezhong self-requested a review July 8, 2024 06:27
Copy link
Copy Markdown

@jovezhong jovezhong left a comment

Choose a reason for hiding this comment

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

Good start. I reckon this PR is working-in-progress. Please add more content with screenshots. Look forwards to the final PR

@ayewo ayewo force-pushed the blog/03_nginx-grafana-metabase branch 2 times, most recently from f57c1ee to e136df8 Compare July 12, 2024 14:56
Copy link
Copy Markdown

@jovezhong jovezhong left a comment

Choose a reason for hiding this comment

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

I shared some comments. Please make the PR as draft PR, as it's not complete yet. I am on travel these 2 weeks so may not provide timely review. Once the PR is ready to review, I will spend more time on this.

@ayewo ayewo closed this Jul 14, 2024
@ayewo ayewo deleted the blog/03_nginx-grafana-metabase branch July 14, 2024 15:57
@ayewo ayewo restored the blog/03_nginx-grafana-metabase branch July 14, 2024 15:57
@ayewo ayewo reopened this Jul 14, 2024
@ayewo ayewo marked this pull request as draft July 17, 2024 13:37
@ayewo ayewo force-pushed the blog/03_nginx-grafana-metabase branch from 54811ec to f6714ce Compare July 17, 2024 13:38
@ayewo ayewo force-pushed the blog/03_nginx-grafana-metabase branch from f6714ce to 91d401a Compare July 18, 2024 13:31
@ayewo ayewo marked this pull request as ready for review July 19, 2024 22:57
@ayewo ayewo requested a review from jovezhong July 20, 2024 20:35
@ayewo
Copy link
Copy Markdown
Contributor Author

ayewo commented Jul 20, 2024

Hi @jovezhong!

I've addressed all of your review comments. This PR is ready for review so hopefully you'll be able to take a look soon.

I hope you are enjoying your travels ✈️ :)

@jovezhong
Copy link
Copy Markdown

Thank you. I will share my feedback in 48 hours, if not sooner.

Copy link
Copy Markdown

@jovezhong jovezhong left a comment

Choose a reason for hiding this comment

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

Again @ayewo , this is a very nice blog with huge potential. Not just for ppl who wants to learn more about streaming processing, for network engineers or anyone who wants to learn more about nginx, network traffic monitoring, or SQL for O11y, this will be a great hit.

I shared my comments. It will great to change the background of the code snippet from blue to dark color as our blog. But this can be time consuming and you can do this later or don't have to do it.

As a reader, I am very excited to see this big dashboard. But the blog ends right here, which is a bit disappointing.

Maybe you can add a few screenshot to explain each panel to highlight why it's helpful to understand the data pattern.

You can also show the SQL behind.

If you can use streaming SQL, then maybe this can be a live dashboard to show the current traffic. In that case, a GIF will be very impressive.

Please also add a short section to summarize the blog and highlight some takeaways.

Before I dive into the article proper, I will first revisit the format used by Nginx to record access log data so that the data we'll generate will mimic its shape and properties.

## The Shape of Nginx's Access Log Data
In the [previous article](https://www.timeplus.com/post/analyzing-nginx-access-logs), we briefly touched on the Nginx access logs but did not dwell on its location or how the data it contains should be parsed.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"its location". I am a bit surprised to see "location". Do you mean how this is generated or data is parsed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Location in this context meant where the Nginx access logs is stored on disk. I've reworded it.


The first line in the access log is from the IP address `161.35.230.x`.

![nginx access log - first line](images/01_nginx-access-log-1st-line.png)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the nice screenshots. I guess you may use tools like https://carbon.sh/ to generate it with background. However since your blog will be posted on timeplus.com with dark background. It will be great if you can use that dark color #0F0D10 to replace the blue background. You may have to change the text color too. Sorry for the trouble

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I hear you.
Yes, I used Carbon and thought that the background I picked would work well with the T+ blog.

I used the Preview.app on macOS which meant creating each one took a lot of time. Maybe I'll find time to recreate them but it shouldn't prevent you from approving this, if there are no other blockers.


### Random Streams
There is an important note about the design of random streams in Timeplus Proton mentioned in the [`RANDOM STREAM`](https://docs.timeplus.com/proton-create-stream#create-random-stream) documentation that is worth highlighting here:
> [!NOTE]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I realized there could be a misunderstanding based on my previous doc, that people may think all data generated will be kept in the memory. I changed that doc to the following text. Please quote it or highlight it in your own words

When you run a Timeplus SQL query with a random stream, the data will be generated and analayzed by the query engine. Depending on the query, all generated data or aggregated states can be kept in memory during the query time. If you are not querying the random stream, there is no data generated or kept in memory.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's still there. Perhaps you updated a different page?

On https://docs.timeplus.com/proton-create-stream#create-random-stream when I do a Ctrl+F for this text:

The data of random stream is kept in memory during the query time. If you are not querying the random stream, there is no data generated or kept in memory.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I will publish that doc change in 1 or 2 hours. Same link

@ayewo
Copy link
Copy Markdown
Contributor Author

ayewo commented Jul 22, 2024

@jovezhong

All feedback addressed!

Copy link
Copy Markdown

@jovezhong jovezhong 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 nice blog. Approved (better to change the title to add Timeplus)

@ayewo ayewo changed the title blog article #03: Visualizing Nginx Access Logs using Grafana and Metabase blog article #03: Visualizing Nginx Access Logs using Timeplus and Grafana Jul 23, 2024
@jovezhong
Copy link
Copy Markdown

/tip 225

@algora-pbc
Copy link
Copy Markdown

algora-pbc bot commented Jul 23, 2024

@jovezhong jovezhong merged commit 602533e into timeplus-io:develop Jul 23, 2024
@algora-pbc
Copy link
Copy Markdown

algora-pbc bot commented Jul 24, 2024

🎉🎈 @ayewo has been awarded $225! 🎈🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants