Class FTPServerMetrics

java.lang.Object
org.bluezoo.gumdrop.ftp.FTPServerMetrics

public class FTPServerMetrics extends Object
OpenTelemetry metrics for FTP servers.

This class provides standardized FTP server metrics for monitoring file transfer operations.

Metrics provided:

  • ftp.server.connections - Total number of FTP control connections
  • ftp.server.active_connections - Number of active control connections
  • ftp.server.session.duration - Session duration in milliseconds
  • ftp.server.authentications - Authentication attempts
  • ftp.server.transfers - File transfers (uploads/downloads)
  • ftp.server.bytes.uploaded - Bytes uploaded by clients
  • ftp.server.bytes.downloaded - Bytes downloaded by clients
  • ftp.server.transfer.duration - File transfer duration
  • ftp.server.commands - FTP commands executed
Author:
Chris Burdess
  • Constructor Details

    • FTPServerMetrics

      public FTPServerMetrics(TelemetryConfig config)
      Creates FTP server metrics using the given telemetry configuration.
      Parameters:
      config - the telemetry configuration
  • Method Details

    • connectionOpened

      public void connectionOpened()
      Records a new FTP control connection.
    • connectionClosed

      public void connectionClosed(double durationMs)
      Records an FTP control connection closing.
      Parameters:
      durationMs - the session duration in milliseconds
    • dataConnectionOpened

      public void dataConnectionOpened()
      Records a data connection opening.
    • dataConnectionClosed

      public void dataConnectionClosed()
      Records a data connection closing.
    • commandExecuted

      public void commandExecuted(String command)
      Records an FTP command execution.
      Parameters:
      command - the command name (e.g., "RETR", "STOR", "LIST")
    • authAttempt

      public void authAttempt()
      Records an authentication attempt.
    • authSuccess

      public void authSuccess()
      Records a successful authentication.
    • authFailure

      public void authFailure()
      Records a failed authentication.
    • fileUploaded

      public void fileUploaded(long sizeBytes, double durationMs)
      Records a file upload (STOR).
      Parameters:
      sizeBytes - the file size in bytes
      durationMs - the transfer duration in milliseconds
    • fileDownloaded

      public void fileDownloaded(long sizeBytes, double durationMs)
      Records a file download (RETR).
      Parameters:
      sizeBytes - the file size in bytes
      durationMs - the transfer duration in milliseconds
    • directoryListed

      public void directoryListed(String command)
      Records a directory listing operation.
      Parameters:
      command - the listing command (LIST, NLST, MLSD)
    • directoryCreated

      public void directoryCreated()
      Records a directory creation.
    • fileDeleted

      public void fileDeleted()
      Records a file deletion.
    • authTlsUpgraded

      public void authTlsUpgraded()
      Records an AUTH TLS upgrade.