npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@posthog/s3-export-plugin

v0.0.7

Published

Export PostHog events to Amazon S3 on ingestion.

Downloads

3

Readme

S3 Export Plugin

Export events to Amazon S3 on ingestion. Archive your data, or simply free it up for other kinds of analysis, by integrating export right into your event processing pipeline.

Available on self-hosted PostHog 1.24.0+

Installation

  1. Access PostHog's Plugins page from the sidebar.
  2. To perform installation either:
    1. go to the Repository tab, find this plugin, and Install it,
    2. or go to the Advanced tab and Fetch and install the following URL in the Install from GitHub, GitLab or npm section:
      https://github.com/posthog/s3-export-plugin.
  3. Configure the plugin by entering your AWS credentials and S3 bucket details.
  4. Watch events roll into S3!

Obtaining AWS Credentials

  1. Log in to AWS.
  2. Open S3 in the AWS console and create a new bucket in your chosen region.
  3. Open IAM and create a new policy to allow access to this bucket.
    1. Open "Policies" and click "Create policy"
    2. On the "Visual Editor" tab, click "Choose a service" and select "S3"
    3. Under "Actions" select
      1. "Write" -> "PutObject"
      2. "Permission Management" -> "PutObjectAcl"
    4. Under "Resources" select "Specific" and click "object" -> "Add ARN"
    5. Specify your bucket name and choose "any" for the object name, so the ARN looks something like this: arn:aws:s3:::my-bucket-name/*
    6. Click "Next" until you end up on the "Review Policy" page
    7. Give it a name
  4. Open IAM and create a new user who uses this policy
    1. Click "Users" -> "Add User"
    2. Specify a name and choose "Programmatic access"
    3. Click "Next"
    4. Select "Attach existing policies directly"
    5. Select the policy you had just created
    6. Click "Next" until you reach the "Create user" button. Click that as well.
    7. Make sure to copy your "Access key" and "Secret access key". The latter will not be shown again.
  5. Install the plugin in PostHog and fill in the "Access key", "Secret access key", "Bucket region" and "Bucket name" fields. Adjust other parameters as needed.

Memory Usage

To vastly increase export throughput, this plugin batches events in memory before uploading them to S3. Upload frequency (every minute by default) and maximum upload size (1 MB by default) can be configured when the plugin is installed.

You should make sure to keep these numbers reasonable to avoid running out of memory on your server. Note that the values apply to each concurrent plugin server thread.

Incorrect S3 Access Configuration Handling

If you incorrectly configured your bucket or access roles, you will not get an error message. This will change once this PostHog plugin server issue is resolved. Thank you for your patience!

Questions?

Join the PostHog Users Slack community.